• 首页
  • Qt文档
  • DTK文档
  • 玲珑文档
  • dsettingsbackend_zh

    Class::DSettingsBackend

    暂无该属性


    Detailed Description

    • ~english *

    DSettingsBackend is interface of DSettings storage class. * * Simaple example: json { "groups": [{ "key": "base", "name": "Basic settings", "groups": [{ "key": "open_action", "name": "Open Action", "options": [{ "key": "alway_open_on_new", "type": "checkbox", "text": "Always Open On New Windows", "default": true }, { "key": "open_file_action", "name": "Open File:", "type": "combobox", "default": "" } ] }, { "key": "new_tab_windows", "name": "New Tab & Window", "options": [{ "key": "new_window_path", "name": "New Window Open:", "type": "combobox", "default": "" }, { "key": "new_tab_path", "name": "New Tab Open:", "type": "combobox", "default": "" } ] } ] }] }

    • How to read/write key and value:
    
    // read settings from json auto settings = Dtk::Core::DSettings::fromJsonFile(":/resources/data/dfm-settings.json"); settings->setBackend(backend);
    
    // read value auto opt = settings->option("base.new_tab_windows.new_window_path"); qDebug() << opt->value();
    
    // modify value opt->setValue("Test") qDebug() << opt->value(); ``` *
    
    *
    
    *
    
    *
    
    *
    
    **See also** Dtk::Core::DSettingsOptionDtk::Core::DSettingsGroupDtk::Core::DSettingsBackendDtk::Widget::DSettingsWidgetFactoryDtk::Widget::DSettingsDialog
    
    # DSettingsBackend::metaObject
    
    <a id="name"></a>
    [<font color="green">public</font>&nbsp;<font color="green">plain</font>&nbsp;<font color="green"></font>&nbsp;<font color="green">virtual</font>]
    
    const QMetaObject * metaObject() const
    
    
    
    # DSettingsBackend::qt_metacast
    
    <a id="name"></a>
    [<font color="green">public</font>&nbsp;<font color="green">plain</font>&nbsp;<font color="green"></font>&nbsp;<font color="green">virtual</font>]
    
    void * qt_metacast(const char *)
    
    
    
    # DSettingsBackend::qt_metacall
    
    <a id="name"></a>
    [<font color="green">public</font>&nbsp;<font color="green">plain</font>&nbsp;<font color="green"></font>&nbsp;<font color="green">virtual</font>]
    
    int qt_metacall(QMetaObject::Call , int , void **)
    
    
    
    # DSettingsBackend::tr
    
    <a id="name"></a>
    [<font color="green">public</font>&nbsp;<font color="green">plain</font>&nbsp;<font color="green">static</font>&nbsp;<font color="green"></font>]
    
    QString tr(const char *s, const char *c, int n)
    
    
    
    # DSettingsBackend::trUtf8
    
    <a id="name"></a>
    [<font color="green">public</font>&nbsp;<font color="green">plain</font>&nbsp;<font color="green">static</font>&nbsp;<font color="green"></font>]
    
    QString trUtf8(const char *s, const char *c, int n)
    
    
    
    # DSettingsBackend::qt_static_metacall
    
    <a id="name"></a>
    [<font color="green">private</font>&nbsp;<font color="green">plain</font>&nbsp;<font color="green">static</font>&nbsp;<font color="green"></font>]
    
    void qt_static_metacall(QObject *, QMetaObject::Call , int , void **)
    
    
    # Class::QPrivateSignal
    
    
    ### DSettingsBackend::QPrivateSignal
    
     <hr />
    
    
    # Detailed Description
    
    
    # DSettingsBackend::DSettingsBackend
    
    <a id="name"></a>
    [<font color="green">public</font>&nbsp;<font color="green">constructor</font>&nbsp;<font color="green"></font>&nbsp;<font color="green"></font>]
    
    DSettingsBackend(QObject *parent)
    
    
    
    # DSettingsBackend::~DSettingsBackend
    
    <a id="name"></a>
    [<font color="green">public</font>&nbsp;<font color="green">destructor</font>&nbsp;<font color="green"></font>&nbsp;<font color="green">virtual</font>]
    
    ~DSettingsBackend()
    
    
    
    # DSettingsBackend::keys
    
    <a id="name"></a>
    [<font color="green">public</font>&nbsp;<font color="green">plain</font>&nbsp;<font color="green"></font>&nbsp;<font color="green"></font>]
    
    QStringList keys() const = 0
    
    
    
    # DSettingsBackend::getOption
    
    <a id="name"></a>
    [<font color="green">public</font>&nbsp;<font color="green">plain</font>&nbsp;<font color="green"></font>&nbsp;<font color="green"></font>]
    
    QVariant getOption(const QString &key) const = 0
    
    
    
    # DSettingsBackend::doSync
    
    <a id="name"></a>
    [<font color="green">public</font>&nbsp;<font color="green">plain</font>&nbsp;<font color="green"></font>&nbsp;<font color="green"></font>]
    
    void doSync() = 0
    
    
    
    # DSettingsBackend::doSetOption
    
    <a id="name"></a>
    [<font color="green">protected</font>&nbsp;<font color="green">plain</font>&nbsp;<font color="green"></font>&nbsp;<font color="green"></font>]
    
    void doSetOption(const QString &key, const QVariant &value) = 0
    
    
    
    # DSettingsBackend::optionChanged
    
    <a id="name"></a>
    [<font color="green">public</font>&nbsp;<font color="green">signal</font>&nbsp;<font color="green"></font>&nbsp;<font color="green"></font>]
    
    void optionChanged(const QString &key, const QVariant &value)
    
    
    
    # DSettingsBackend::sync
    
    <a id="name"></a>
    [<font color="green">public</font>&nbsp;<font color="green">signal</font>&nbsp;<font color="green"></font>&nbsp;<font color="green"></font>]
    
    void sync()
    
    
    
    # DSettingsBackend::setOption
    
    <a id="name"></a>
    [<font color="green">public</font>&nbsp;<font color="green">signal</font>&nbsp;<font color="green"></font>&nbsp;<font color="green"></font>]
    
    void setOption(const QString &key, const QVariant &value)