(settings, key, scheme)
return items
Read the whole array from a QSettings instance.

    Parameters
    ----------
    settings : QSettings
    key : str
    scheme : Dict[str, ValueSpec]

    Example
    -------
    >>> s = QSettings("./login.ini")
    >>> QSettings_readArray(s, "array", {"username": str, "password": str})
    [{"username": "darkhelmet", "password": "1234"}}
    >>> QSettings_readArray(
    ...    s, "array", {"username": str, "noexist": (str, "~||~")})
    ...
    [{"username": "darkhelmet", "noexist": "~||~"}}
Read the whole array from a QSettings instance.
Read the whole array from a QSettings instance .
def QSettings_readArray(settings, key, scheme):
    # type: (QSettings, str, Mapping[str, ValueSpec]) -> List[Dict[str, Any]]
    """
    Read the whole array from a QSettings instance.

    Parameters
    ----------
    settings : QSettings
    key : str
    scheme : Dict[str, ValueSpec]

    Example
    -------
    >>> s = QSettings("./login.ini")
    >>> QSettings_readArray(s, "array", {"username": str, "password": str})
    [{"username": "darkhelmet", "password": "1234"}}
    >>> QSettings_readArray(
    ...    s, "array", {"username": str, "noexist": (str, "~||~")})
    ...
    [{"username": "darkhelmet", "noexist": "~||~"}}
    """
    items = []
    count = settings.beginReadArray(key)

    def normalize_spec(spec):
        if isinstance(spec, tuple):
            if len(spec) != 2:
                raise ValueError("len(spec) != 2")
            type_, default = spec
        else:
            type_, default = spec, None
        return type_, default

    specs = {
        name: normalize_spec(spec) for name, spec in scheme.items()
    }
    for i in range(count):
        settings.setArrayIndex(i)
        item = {}
        for key, (type_, default) in specs.items():
            value = settings.value(key, type=type_, defaultValue=default)
            item[key] = value
        items.append(item)
    settings.endArray()
    return items
def QSettings_readArray ( settings , key , scheme ) : # type: (QSettings, str, Mapping[str, ValueSpec]) -> List[Dict[str, Any]] items = [ ] count = settings . beginReadArray ( key ) def normalize_spec ( spec ) : if isinstance ( spec , tuple ) : if len ( spec ) != 2 : raise ValueError ( "len(spec) != 2" ) type_ , default = spec else : type_ , default = spec , None return type_ , default specs = { name : normalize_spec ( spec ) for name , spec in scheme . items ( ) } for i in range ( count ) : settings . setArrayIndex ( i ) item = { } for key , ( type_ , default ) in specs . items ( ) : value = settings . value ( key , type = type_ , defaultValue = default ) item [ key ] = value items . append ( item ) settings . endArray ( ) return items