- qtgui
- qtdbus
- qtwidgets
- qtcore
- dtkcore
- qsettingbackend_zh
- dobject_zh
- abstractappender_zh
- abstractstringappender_zh
- dfilewatcher_zh
- outputdebugappender_zh
- dsettingsbackend_zh
- drecentmanager_zh
- ddesktopentry_zh
- consoleappender_zh
- gsettingsbackend_zh
- dsettingsgroup_zh
- dlogmanager_zh
- fileappender_zh
- dsettings_zh
- dfilesystemwatcher_zh
- dfilewatchermanager_zh
- dbasefilewatcher_zh
- dtkgui
- dtkwidget
- dviewitemaction_zh
- dstandarditem_zh
- dfiledialog_zh
- dclipeffectwidget_zh
- danchors_zh
- dgraphicsclipeffect_zh
- dstyle_zh
- dcoloredprogressbar_zh
- dbuttonboxbutton_zh
- dlabel_zh
- dtiplabel_zh
- darrowlinedrawer_zh
- daboutdialog_zh
- dsettingswidgetfactory_zh
- dsearchcombobox_zh
- dcrumbedit_zh
- dcommandlinkbutton_zh
- dsettingsdialog_zh
- dwindowoptionbutton_zh
- dspinner_zh
- dsimplelistview_zh
- dwaterprogress_zh
- dmainwindow_zh
- dhidpihelper_zh
- dslider_zh
- dpasswordedit_zh
- danchorinfo_zh
- dmpriscontrol_zh
- darrowbutton_zh
- dbackgroundgroup_zh
- dcircleprogress_zh
- dwarningbutton_zh
- dwindowclosebutton_zh
- dvideowidget_zh
- dfilechooseredit_zh
- dblureffectwidget_zh
- darrowrectangle_zh
- dsearchedit_zh
- dfloatingmessage_zh
- dswitchlineexpand_zh
- dtabbar_zh
- dlineedit_zh
- danchorsbase_zh
- dstylediconengine_zh
- dwindowmaxbutton_zh
- dpageindicator_zh
- dsuggestbutton_zh
- dapplicationsettings_zh
- dtooltip_zh
- dwindowminbutton_zh
- ddrawer_zh
- dtitlebar_zh
- dsimplelistitem_zh
- dpicturesequenceview_zh
dsettings_zh
Class::DSettings
暂无该属性
Detailed Description
- ~chinese *
DSettings 是设计上为Dtk的应用程序提供统一的配置存储以及界面生成工具的基础库。 * DSetting使用json作为应用配置程序的描述文件。简单来说,应用查询的配置分为组/键值二个基础层级, * 对于一个标准的Dtk配置控件,一般只包含组/子组/键值三个层级,对于超过三个层级的键值,可以通过 * DSettings 的API接口进行读取和写入,但是不能在标准的DSettingsDialogs上显示出来。 * * 一个简单的配置文件如下: 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": "" } ] } ] }] }
- 改组中包含一个base的root组,两个子组: open_action/new_tab_windows,每个子组有包含若干选项。 * 对于"New Window Open:"这个配置,其完整的访问id为base.new_tab_windows.new_window_path。 * 读取/设置其值的示例如下:
// 从json中初始化配置 auto settings = Dtk::Core::DSettings::fromJsonFile(":/resources/data/dfm-settings.json"); settings-> [setBackend](#setBackend) (backend);
// 读取配置 auto opt = settings->option("base.new_tab_windows.new_window_path"); qDebug() << opt-> [value()](#value) ;
// 修改配置 opt->setValue("Test") qDebug() << opt-> [value()](#value) ; ``` *
*
*
*
*
**See also** Dtk::Core::DSettingsOptionDtk::Core::DSettingsGroupDtk::Core::DSettingsBackendDtk::Widget::DSettingsWidgetFactoryDtk::Widget::DSettingsDialog
# DSettings::metaObject
<a id="name"></a>
[<font color="green">public</font> <font color="green">plain</font> <font color="green"></font> <font color="green">virtual</font>]
const QMetaObject * metaObject() const
# DSettings::qt_metacast
<a id="name"></a>
[<font color="green">public</font> <font color="green">plain</font> <font color="green"></font> <font color="green">virtual</font>]
void * qt_metacast(const char *)
# DSettings::qt_metacall
<a id="name"></a>
[<font color="green">public</font> <font color="green">plain</font> <font color="green"></font> <font color="green">virtual</font>]
int qt_metacall(QMetaObject::Call , int , void **)
# DSettings::tr
<a id="name"></a>
[<font color="green">public</font> <font color="green">plain</font> <font color="green">static</font> <font color="green"></font>]
QString tr(const char *s, const char *c, int n)
# DSettings::trUtf8
<a id="name"></a>
[<font color="green">public</font> <font color="green">plain</font> <font color="green">static</font> <font color="green"></font>]
QString trUtf8(const char *s, const char *c, int n)
# DSettings::qt_static_metacall
<a id="name"></a>
[<font color="green">private</font> <font color="green">plain</font> <font color="green">static</font> <font color="green"></font>]
void qt_static_metacall(QObject *, QMetaObject::Call , int , void **)
# Class::QPrivateSignal
### DSettings::QPrivateSignal
<hr />
# Detailed Description
# DSettings::DSettings
<a id="name"></a>
[<font color="green">public</font> <font color="green">constructor</font> <font color="green"></font> <font color="green"></font>]
DSettings(QObject *parent)
# DSettings::~DSettings
<a id="name"></a>
[<font color="green">public</font> <font color="green">destructor</font> <font color="green"></font> <font color="green">virtual</font>]
~DSettings()
# DSettings::setBackend
<a id="name"></a>
[<font color="green">public</font> <font color="green">plain</font> <font color="green"></font> <font color="green"></font>]
void setBackend(DSettingsBackend *backend)
# DSettings::fromJson
<a id="name"></a>
[<font color="green">public</font> <font color="green">plain</font> <font color="green">static</font> <font color="green"></font>]
QPointer<DSettings> fromJson(const QByteArray &json)
# DSettings::fromJsonFile
<a id="name"></a>
[<font color="green">public</font> <font color="green">plain</font> <font color="green">static</font> <font color="green"></font>]
QPointer<DSettings> fromJsonFile(const QString &filepath)
# DSettings::meta
<a id="name"></a>
[<font color="green">public</font> <font color="green">plain</font> <font color="green"></font> <font color="green"></font>]
QJsonObject meta() const
# DSettings::keys
<a id="name"></a>
[<font color="green">public</font> <font color="green">plain</font> <font color="green"></font> <font color="green"></font>]
QStringList keys() const
# DSettings::options
<a id="name"></a>
[<font color="green">public</font> <font color="green">plain</font> <font color="green"></font> <font color="green"></font>]
QList<QPointer<DSettingsOption> > options() const
# DSettings::option
<a id="name"></a>
[<font color="green">public</font> <font color="green">plain</font> <font color="green"></font> <font color="green"></font>]
QPointer<DSettingsOption> option(const QString &key) const
**See also** [setOption()](#setOption)
# DSettings::value
<a id="name"></a>
[<font color="green">public</font> <font color="green">plain</font> <font color="green"></font> <font color="green"></font>]
QVariant value(const QString &key) const
# DSettings::groupKeys
<a id="name"></a>
[<font color="green">public</font> <font color="green">plain</font> <font color="green"></font> <font color="green"></font>]
QStringList groupKeys() const
# DSettings::groups
<a id="name"></a>
[<font color="green">public</font> <font color="green">plain</font> <font color="green"></font> <font color="green"></font>]
QList<QPointer<DSettingsGroup> > groups() const
# DSettings::group
<a id="name"></a>
[<font color="green">public</font> <font color="green">plain</font> <font color="green"></font> <font color="green"></font>]
QPointer<DSettingsGroup> group(const QString &key) const
will recurrence find childGroup *key* Returns
# DSettings::getOption
<a id="name"></a>
[<font color="green">public</font> <font color="green">plain</font> <font color="green"></font> <font color="green"></font>]
QVariant getOption(const QString &key) const
# DSettings::valueChanged
<a id="name"></a>
[<font color="green">public</font> <font color="green">signal</font> <font color="green"></font> <font color="green"></font>]
void valueChanged(const QString &key, const QVariant &value)
# DSettings::sync
<a id="name"></a>
[<font color="green">public</font> <font color="green">slot</font> <font color="green"></font> <font color="green"></font>]
void sync()
# DSettings::setOption
<a id="name"></a>
[<font color="green">public</font> <font color="green">slot</font> <font color="green"></font> <font color="green"></font>]
void setOption(const QString &key, const QVariant &value)
**See also** [option()](#option)
# DSettings::reset
<a id="name"></a>
[<font color="green">public</font> <font color="green">slot</font> <font color="green"></font> <font color="green"></font>]
void reset()
# DSettings::parseJson
<a id="name"></a>
[<font color="green">private</font> <font color="green">plain</font> <font color="green"></font> <font color="green"></font>]
void parseJson(const QByteArray &json)
# DSettings::loadValue
<a id="name"></a>
[<font color="green">private</font> <font color="green">plain</font> <font color="green"></font> <font color="green"></font>]
void loadValue()
# DSettings::d_func
<a id="name"></a>
[<font color="green">private</font> <font color="green">plain</font> <font color="green"></font> <font color="green"></font>]
DSettingsPrivate * d_func()
# DSettings::d_func
<a id="name"></a>
[<font color="green">private</font> <font color="green">plain</font> <font color="green"></font> <font color="green"></font>]
const DSettingsPrivate * d_func() const