def writeNestedListToSettings(settings, key, values, props, transforms=None):
    """
    Writes a nested list to settings
    
    :param settings QSettings: Settings object to write from
    :param key str: The section the array will reside in
    :param values QStandardItemModel: The array to write
    :param props dict: A dict containing mappings from Qt Item roles
        to array property names.
    :param transforms dict: A dict containing mappings from Qt Item roles
        to callables that transform it into the right type.

    .. tip::
        Example props parameter.

        .. code-block:: python

            {
                Qt.DisplayRole:'testProp',
                Qt.UserRole   :'testProp2',
                Qt.UserRole+1 :'testProp3',
            }
    """
    if transforms is None:
        transforms = {}
    settings.beginWriteArray(key)
    size = values.rowCount()
    for i in range(size):
        settings.setArrayIndex(i)
        val = values.item(i)
        for prop in props:
            value = val.data(prop)
            if prop in transforms:
                value = transforms[prop](value)
            settings.setValue(props[prop], value)
    settings.endArray()
