New upstream version 2.0.9.14
authorBoyuan Yang <byang@debian.org>
Thu, 3 Jan 2019 15:17:08 +0000 (10:17 -0500)
committerBoyuan Yang <byang@debian.org>
Thu, 3 Jan 2019 15:17:08 +0000 (10:17 -0500)
12 files changed:
CHANGELOG.md
conanfile.py [new file with mode: 0644]
src/base/dsingleton.h
src/dtk_module.prf
src/filesystem/dpathbuf.cpp
src/filesystem/dpathbuf.h
src/log/AbstractAppender.cpp
src/log/AbstractStringAppender.cpp
src/log/Logger.cpp
src/settings/dsettingsgroup.cpp
src/settings/dsettingsoption.cpp
src/src.pro

index 56527aebc32c50d3c72142d43a626c3c379b192a..7db426efe171915586a2dc5a935fd735a66d4b83 100644 (file)
@@ -1,3 +1,29 @@
+<a name="2.0.9.14"></a>
+## 2.0.9.14 (2019-01-02)
+
+
+
+
+<a name="2.0.9.13"></a>
+## 2.0.9.13 (2018-12-28)
+
+
+
+
+<a name="2.0.9.12"></a>
+## 2.0.9.12 (2018-12-24)
+
+
+#### Bug Fixes
+
+* **DPathBuf:**  missing default constructor ([74374cb4](https://github.com/linuxdeepin/dtkcore/commit/74374cb4cf0245ab1fe73f62fe0d13566f945db3))
+
+#### Features
+
+*   support connan build ([ba2d213f](https://github.com/linuxdeepin/dtkcore/commit/ba2d213fd6c7e36e118288305e5892c339250623))
+
+
+
 <a name="2.0.9.11"></a>
 ## 2.0.9.11 (2018-12-14)
 
diff --git a/conanfile.py b/conanfile.py
new file mode 100644 (file)
index 0000000..3a6161f
--- /dev/null
@@ -0,0 +1,87 @@
+from conans import ConanFile, tools
+
+
+class DtkcoreConan(ConanFile):
+    name = 'dtkcore'
+    version = '2.0.9'
+    license = 'GPL'
+    author = 'Iceyer me@iceyer.net'
+    url = 'https://github.com/linuxdeepin/dtkcore'
+    description = 'cross platform ui library'
+    topics = ('qt', 'dtk')
+    settings = 'os', 'compiler', 'build_type', 'arch'
+    options = {'shared': [True, False]}
+    default_options = 'shared=False'
+    generators = 'qmake'
+    exports_sources = '*'
+    requires = 'jom_installer/1.1.2@bincrafters/stable', 'qt/5.6.3@iceyer/stable'
+
+    def extend_include_path(self):
+        return '%s/include/libdtk-%s/DCore' % (self.package_folder, self.version)
+
+    # def source(self):
+    #     self.run('git clone https://github.com/linuxdeepin/dtkcore.git source')
+    #     self.run('cd source && git checkout 2.0.9.9')
+
+    def build(self):
+        outdir = self.build_folder
+        # includedir = outdir + '/include'
+        mkspecsdir = outdir + '/mkspecs'
+        # libdir = outdir + '/lib'
+
+        env_vars = tools.vcvars_dict(self.settings)
+        env_vars['_CL_'] = '/utf-8'
+        with tools.environment_append(env_vars):
+            command = 'qmake -r'
+            command += ' VERSION=%s' % self.version
+            # command += ' CONFIG-=debug_and_release'
+            # command += ' CONFIG-=debug_and_release_target'
+            command += ' CONFIG+=release'
+            command += ' PREFIX=%s' % outdir
+            command += ' MKSPECS_INSTALL_DIR=%s' % mkspecsdir
+            command += ' DTK_STATIC_LIB=YES'
+            command += ' DTK_STATIC_TRANSLATION=YES'
+            command += ' DTK_NO_MULTIMEDIA=YES'
+            command += ' %s' % self.source_folder
+            self.run(command)
+            self.run('jom clean')
+            self.run('jom')
+            self.run('jom install')
+
+    def package(self):
+        self.deploy()
+
+        outdir = self.build_folder
+        self.copy('*', dst='include', src=outdir+'/include')
+        self.copy('*.lib', dst='lib', src=outdir+'/lib')
+        self.copy('*', dst='mkspecs', src=outdir+'/mkspecs')
+
+    def package_info(self):
+        self.cpp_info.libs = ['dtkcore']
+        self.cpp_info.includedirs.append(self.extend_include_path())
+        self.env_info.QMAKEPATH = self.cpp_info.rootpath
+        self.env_info.QMAKEFEATURES = self.cpp_info.rootpath + '/mkspecs/features'
+
+    def deploy(self):
+        try:
+            content = []
+            module_pri = self.build_folder + '/mkspecs/modules/qt_lib_dtkcore.pri'
+            s = open(module_pri)
+            for line in s.readlines():
+                if line.startswith('QT.dtkcore.tools'):
+                    line = 'QT.dtkcore.tools = %s\n' % (
+                        self.package_folder + '/bin')
+                elif line.startswith('QT.dtkcore.libs'):
+                    line = 'QT.dtkcore.libs = %s\n' % (
+                        self.package_folder + '/lib')
+                elif line.startswith('QT.dtkcore.includes'):
+                    line = 'QT.dtkcore.includes = %s\n' % (
+                        self.extend_include_path())
+                content.append(line)
+            s.close()
+
+            # print('create module file', content)
+            s = open(module_pri, 'w')
+            s.writelines(content)
+        except FileNotFoundError:
+            print('skip update qt module file')
index 6c0e37e2e96715364b511ede5a8343e7de0605d6..f404da209c4abde34ea408c04ee804ed933e72d0 100644 (file)
 DCORE_BEGIN_NAMESPACE
 
 /*!
- * a simple singleton template for std c++ 11 or later.
+ * \~english a simple singleton template for std c++ 11 or later.
  *
  * example:
+
+```
+   class ExampleSingleton : public QObject, public Dtk::DSingleton<ExampleSingleton>
+   {
+       Q_OBJECT
+       friend class DSingleton<ExampleSingleton>;
+   };
+```
+
+ * \note: for Qt, "public DSingleton<ExampleSingleton>" must be after QObject.
+ */
+
+
+/*!
+ * \~chinese 通过c++11的特性实现的单例模板
  *
- *  class ExampleSingleton : public QObject, public Dtk::DSingleton<ExampleSingleton>
- *  {
- *      Q_OBJECT
- *      friend class DSingleton<ExampleSingleton>;
- *  };
- *
- * Warning: for Qt, "public DSingleton<LyricService>" must be after QObject.
+ * 使用示例:
+
+```
+   class ExampleSingleton : public QObject, public Dtk::DSingleton<ExampleSingleton>
+   {
+       Q_OBJECT
+       friend class DSingleton<ExampleSingleton>;
+   };
+```
+
+ * \note 对于Qt程序 public DSingleton<ExampleSingleton>" 必须在卸载QObject后面出现。
  */
 
 template <class T>
index d26330df9b8a6be7ef3218583899c2bff2710a5a..b42934deaf02b357f00dc849bbb89e10edacb778 100644 (file)
@@ -99,7 +99,11 @@ write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.")
 
 QT_HOST_DATA=$$system(qmake -query QT_HOST_DATA)
 qt_module.files = $$MODULE_PRI
-qt_module.path = $${QT_HOST_DATA}/mkspecs/modules
+
+isEmpty(MKSPECS_INSTALL_DIR) {
+    MKSPECS_INSTALL_DIR=$${QT_HOST_DATA}/mkspecs
+}
+qt_module.path = $${MKSPECS_INSTALL_DIR}/modules
 
 INSTALLS += qt_module
 
index cd5aa62b12862ef3d94e9ce04c98754724631334..c36195df41d153181bb271b83851bfbe970131b4 100644 (file)
@@ -27,4 +27,10 @@ DPathBuf::DPathBuf(const QString &path)
     m_path = QDir(path).absolutePath();
 }
 
+DPathBuf::DPathBuf()
+    : DPathBuf(QString())
+{
+
+}
+
 DCORE_END_NAMESPACE
index aa5c997fcd98645834a19e218ebe05261846a2e9..bceb38974e4e27818648bb03c4d82c7693f82081 100644 (file)
@@ -26,6 +26,7 @@ DCORE_BEGIN_NAMESPACE
 class LIBDTKCORESHARED_EXPORT DPathBuf
 {
 public:
+    DPathBuf();
     DPathBuf(const QString &path);
 
     /*!
index a4fe3405a10b0aef50cd8c4918736248a37e2f14..049869544f042769c715bcf6c8da6290bf0c84b7 100644 (file)
@@ -43,7 +43,7 @@ DCORE_BEGIN_NAMESPACE
  * imagine.
  *
  * For the simple non-structured plain text logging (for example, to a plain text file or to the console output) you may
- * like to subclass the AbstractStringAppender instead of AbstractAppender, which will give you a more convinient way to
+ * like to subclass the AbstractStringAppender instead of AbstractAppender, which will give you a more convenient way to
  * control the format of the log output.
  *
  * \sa AbstractStringAppender
index 175730320165e428b4bf912c299291e0405c3b7b..ef6ee8f1daae4a2c3be60c90923cef7b8f82a217 100644 (file)
@@ -29,10 +29,10 @@ DCORE_BEGIN_NAMESPACE
 /**
  * \class AbstractStringAppender
  *
- * \brief The AbstractStringAppender class provides a convinient base for appenders working with plain text formatted
+ * \brief The AbstractStringAppender class provides a convenient base for appenders working with plain text formatted
  *        logs.
  *
- * AbstractSringAppender is the simple extension of the AbstractAppender class providing the convinient way to create
+ * AbstractSringAppender is the simple extension of the AbstractAppender class providing the convenient way to create
  * custom log appenders working with a plain text formatted log targets.
  *
  * It have the formattedString() protected function that formats the logging arguments according to a format set with
index 72b6935289f6bed0540434cd49ff9c74f45f940c..d482d5e2e590c9e1493b80329c988191b399f7a7 100644 (file)
@@ -62,11 +62,11 @@ DCORE_BEGIN_NAMESPACE
  *
  * \brief Writes the trace log record
  *
- * This macro is the convinient way to call Logger::write(). It uses the common preprocessor macros \c __FILE__,
+ * This macro is the convenient way to call Logger::write(). It uses the common preprocessor macros \c __FILE__,
  * \c __LINE__ and the standard Qt \c Q_FUNC_INFO macros to automatically determine the needed parameters to call
  * Logger::write().
  *
- * \note This and other (dInfo() etc...) macros uses the variadic macro arguments to give convinient usage form for
+ * \note This and other (dInfo() etc...) macros uses the variadic macro arguments to give convenient usage form for
  * the different versions of Logger::write() (using the QString or const char* argument or returning the QDebug class
  * instance). Not all compilers will support this. Please, consider reviewing your compiler documentation to ensure
  * it support __VA_ARGS__ macro.
@@ -293,7 +293,7 @@ DCORE_BEGIN_NAMESPACE
  *
  * \brief Check the assertion
  *
- * This macro is a convinient and recommended to use way to call Logger::writeAssert() function. It uses the
+ * This macro is a convenient and recommended to use way to call Logger::writeAssert() function. It uses the
  * preprocessor macros (as the dDebug() does) to fill the necessary arguments of the Logger::writeAssert() call. It
  * also uses undocumented but rather mature and stable \c qt_noop() function (which does nothing) when the assertion
  * is true.
index 1b49d88e5d2338c3af23a2278a9d430948827bde..5bfbfbedf02873eebc64990fd84888637538bd84 100644 (file)
@@ -48,10 +48,15 @@ public:
 };
 
 /*!
- * \class DSettingsGroup
+ * \~english \class DSettingsGroup
  * \brief A group of DSettingsOption and DSettingsGroup.
  * DSettingsGroup can contain a lost option and subgroup.
  */
+/*!
+ * \chinese \class DSettingsGroup
+ * \brief 一组DSettings选项的集合,也可以包含子组。
+ */
+
 
 DSettingsGroup::DSettingsGroup(QObject *parent) :
     QObject(parent), dd_ptr(new DSettingsGroupPrivate(this))
@@ -63,8 +68,13 @@ DSettingsGroup::~DSettingsGroup()
 {
 
 }
+
+/*!
+ * \~english \brief Get direct parent group of this group.
+ * \return
+ */
 /*!
- * \brief Get direct parent group of this group.
+ * \~chinese \brief 获取当前组的父组。
  * \return
  */
 QPointer<DSettingsGroup> DSettingsGroup::parentGroup() const
@@ -74,8 +84,10 @@ QPointer<DSettingsGroup> DSettingsGroup::parentGroup() const
 }
 
 /*!
- * \brief Change the direct parent group of this group.
- * \param parentGroup
+ * \~english \brief Change the direct parent group of this group.
+ */
+/*!
+ * \~chinese \brief 设置但前组的父组。
  */
 void DSettingsGroup::setParentGroup(QPointer<DSettingsGroup> parentGroup)
 {
@@ -84,9 +96,12 @@ void DSettingsGroup::setParentGroup(QPointer<DSettingsGroup> parentGroup)
 }
 
 /*!
- * \brief Return the full key of this group, include all parent.
+ * \~english \brief Return the full key of this group, include all parent.
  * \return
  */
+/*!
+ * \~chinese \brief 返回这个组的键,会包含全部的父组的键。
+ */
 QString DSettingsGroup::key() const
 {
     Q_D(const DSettingsGroup);
@@ -94,8 +109,10 @@ QString DSettingsGroup::key() const
 }
 
 /*!
- * \brief Get display name of this group, it may be translated.
- * \return
+ * \~english \brief Get display name of this group, it may be translated.
+ */
+/*!
+ * \~chinese \brief 返回这个组名称。
  */
 QString DSettingsGroup::name() const
 {
@@ -104,9 +121,13 @@ QString DSettingsGroup::name() const
 }
 
 /*!
- * \brief Check this group will show on DSettings dialog.
+ * \~english \brief Check this group will show on DSettings dialog.
  * \return true if group not bind to ui element.
  */
+/*!
+ * \~chinese \brief 检查这个选项组是否会在界面上显示。
+ * \return true 表示则这个选项组会显示出来。
+ */
 bool DSettingsGroup::isHidden() const
 {
     Q_D(const DSettingsGroup);
@@ -114,9 +135,12 @@ bool DSettingsGroup::isHidden() const
 }
 
 /*!
- * \brief Get the child group of groupKey
+ * \~english \brief Get the child group of groupKey
  * \param groupKey is child group key
- * \return
+ */
+/*!
+ * \~chinese \brief 返回给定键在选项组中对应的子组。
+ * \param groupKey 子组的键
  */
 QPointer<DSettingsGroup> DSettingsGroup::childGroup(const QString &groupKey) const
 {
@@ -125,9 +149,12 @@ QPointer<DSettingsGroup> DSettingsGroup::childGroup(const QString &groupKey) con
 }
 
 /*!
- * \brief Get the child option of key
+ * \~english \brief Get the child option of key
  * \param key is child option key
- * \return
+ */
+/*!
+ * \~chinese \brief 根据键值获取选项。
+ * \param key 选项的完整键
  */
 QPointer<DSettingsOption> DSettingsGroup::option(const QString &key) const
 {
@@ -136,8 +163,10 @@ QPointer<DSettingsOption> DSettingsGroup::option(const QString &key) const
 }
 
 /*!
- * \brief Enum all direct child group of this group
- * \return
+ * \~english \brief Enum all direct child group of this group
+ */
+/*!
+ * \~chinese \brief 列出组下面所有的直接子组。
  */
 QList<QPointer<DSettingsGroup> > DSettingsGroup::childGroups() const
 {
@@ -150,7 +179,11 @@ QList<QPointer<DSettingsGroup> > DSettingsGroup::childGroups() const
 }
 
 /*!
- * \brief Enum all direct child option with the raw order in json description file.
+ * \~english \brief Enum all direct child option with the raw order in json description file.
+ * \return
+ */
+/*!
+ * \~chinese \brief 列出组下面所有的直接选项。
  * \return
  */
 QList<QPointer<DSettingsOption> > DSettingsGroup::childOptions() const
@@ -164,7 +197,11 @@ QList<QPointer<DSettingsOption> > DSettingsGroup::childOptions() const
 }
 
 /*!
- * \brief Enum all direct child option of this group.
+ * \~english \brief Enum all direct child option of this group.
+ * \return
+ */
+/*!
+ * \~chinese \brief 列出组下面所有的选项。
  * \return
  */
 QList<QPointer<DSettingsOption> > DSettingsGroup::options() const
@@ -174,11 +211,17 @@ QList<QPointer<DSettingsOption> > DSettingsGroup::options() const
 }
 
 /*!
- * \brief Convert QJsonObject to DSettingsGroup.
+ * \~english \brief Convert QJsonObject to DSettingsGroup.
  * \param prefixKey instead parse prefix key from parent.
  * \param json is an QJsonObejct instance.
  * \sa QPointer<DSettingsOption> Dtk::Core::DSettingsGroup::parseJson(const QString &prefixKey, const QJsonObject &json)
  */
+/*!
+ * \~chinese \brief 将json对象转化为DSettingsGroup
+ * \param prefixKey 组键值前缀
+ * \param json 待反序列化的json对象
+ * \sa QPointer<DSettingsOption> Dtk::Core::DSettingsGroup::parseJson(const QString &prefixKey, const QJsonObject &json)
+ */
 QPointer<DSettingsGroup> DSettingsGroup::fromJson(const QString &prefixKey, const QJsonObject &group)
 {
     auto groupPtr = QPointer<DSettingsGroup>(new DSettingsGroup);
@@ -187,11 +230,17 @@ QPointer<DSettingsGroup> DSettingsGroup::fromJson(const QString &prefixKey, cons
 }
 
 /*!
- * \brief Parse QJsonObject to DSettingsGroup.
+ * \~english \brief Parse QJsonObject to DSettingsGroup.
  * \param prefixKey instead parse prefix key from parent.
  * \param json is an QJsonObejct instance.
  * \sa QPointer<DSettingsOption> Dtk::Core::DSettingsGroup::fromJson(const QString &prefixKey, const QJsonObject &json)
  */
+/*!
+ * \~chinese \brief 将json对象转化为DSettingsGroup
+ * \param prefixKey 组键值前缀
+ * \param json 待反序列化的json对象
+ * \sa QPointer<DSettingsOption> Dtk::Core::DSettingsGroup::fromJson(const QString &prefixKey, const QJsonObject &json)
+ */
 void DSettingsGroup::parseJson(const QString &prefixKey, const QJsonObject &group)
 {
     Q_D(DSettingsGroup);
index 82419f9cc77eed0dd44a004b27a43f37d5401d44..1a6cd69f2bded80a23539acaf6e93aabc702cf98 100644 (file)
@@ -46,7 +46,7 @@ public:
 };
 
 /*!
- * \class DSettingsOption
+ * \~english \class DSettingsOption
  * \brief DSettingsOption is the base key/value item of DSettings.
  *
  * \fn void DSettingsOption::valueChanged(QVariant value);
@@ -56,11 +56,27 @@ public:
  * \brief Emit when option data change.
  *
  *
-
  * \property DSettingsOption::value
  * \brief Current value of this option.
  */
 
+
+/*!
+ * \~chinese \class DSettingsOption
+ * \brief DSettingsOption是DSettings的基本单元,用于存放一对键-值数据。
+ *
+ * \fn void DSettingsOption::valueChanged(QVariant value);
+ * \brief 选项的数据变化时发出改信息
+ *
+ * \fn void DSettingsOption::dataChanged(const QString &dataType, QVariant value);
+ * \brief 选项的附件的额外数据变化时发出改信息,可以看作这个值的属性发生变化。
+ *
+ *
+ * \property DSettingsOption::value
+ * \brief 选项的当前值。
+ */
+
+
 DSettingsOption::DSettingsOption(QObject *parent) :
     QObject(parent), dd_ptr(new DSettingsOptionPrivate(this))
 {
@@ -72,7 +88,11 @@ DSettingsOption::~DSettingsOption()
 }
 
 /*!
- * \brief Get direct parent group of this option.
+ * \~english \brief Get direct parent group of this option.
+ * \return
+ */
+/*!
+ * \~chinese \brief 当前选项的直接上级组。
  * \return
  */
 QPointer<DSettingsGroup> DSettingsOption::parentGroup() const
@@ -82,9 +102,13 @@ QPointer<DSettingsGroup> DSettingsOption::parentGroup() const
 }
 
 /*!
- * \brief Change the direct parent group of this option.
+ * \~english \brief Change the direct parent group of this option.
  * \param parentGroup
  */
+/*!
+ * \~chinese \brief 修改但前选项的上级组。
+ * \return
+ */
 void DSettingsOption::setParentGroup(QPointer<DSettingsGroup> parentGroup)
 {
     Q_D(DSettingsOption);
@@ -92,7 +116,11 @@ void DSettingsOption::setParentGroup(QPointer<DSettingsGroup> parentGroup)
 }
 
 /*!
- * \brief Return the full key of this option, include all parent.
+ * \~english \brief Return the full key of this option, include all parent.
+ * \return
+ */
+/*!
+ * \~chinese \brief 但前选项的键值。
  * \return
  */
 QString DSettingsOption::key() const
@@ -102,7 +130,11 @@ QString DSettingsOption::key() const
 }
 
 /*!
- * \brief Get display name of the option, it may be translated.
+ * \~english \brief Get display name of the option, it may be translated.
+ * \return
+ */
+/*!
+ * \~chinese \brief 但前选项的名称。
  * \return
  */
 QString DSettingsOption::name() const
@@ -112,10 +144,14 @@ QString DSettingsOption::name() const
 }
 
 /*!
- * \brief Check this option can be reset to default value. if false, reset action will not take effect.
+ * \~english \brief Check this option can be reset to default value. if false, reset action will not take effect.
  * \return true if can be reset.
  * \sa Dtk::Core::DSettings::reset
  */
+/*!
+ * \~chinese \brief 选项是否可以重置,如果可以重置,在调用reset方法后,选项的值会变成初始值。
+ * \return
+ */
 bool DSettingsOption::canReset() const
 {
     Q_D(const DSettingsOption);
@@ -123,7 +159,11 @@ bool DSettingsOption::canReset() const
 }
 
 /*!
- * \brief Default value of this option, must config in this json desciption file.
+ * \~english \brief Default value of this option, must config in this json desciption file.
+ * \return
+ */
+/*!
+ * \~chinese \brief 选项的默认值。
  * \return
  */
 QVariant DSettingsOption::defaultValue() const
@@ -133,7 +173,11 @@ QVariant DSettingsOption::defaultValue() const
 }
 
 /*!
- * \brief Get current value of option.
+ * \~english \brief Get current value of option.
+ * \return
+ */
+/*!
+ * \~chinese \brief 选项的当前值。
  * \return
  */
 QVariant DSettingsOption::value() const
@@ -143,12 +187,18 @@ QVariant DSettingsOption::value() const
 }
 
 /*!
- * \brief Custom data of option, like QObject::property.
+ * \~english \brief Custom data of option, like QObject::property.
  * \param dataType
  * \return
  * \sa QObject::property
  * \sa Dtk::Core::DSettingsOption::setData
  */
+/*!
+ * \~chinese \brief 选项的附件data,用于未选项设置一些额外的辅助属性。
+ * \return
+ * \sa QObject::property
+ * \sa Dtk::Core::DSettingsOption::setData
+ */
 QVariant DSettingsOption::data(const QString &dataType) const
 {
     Q_D(const DSettingsOption);
@@ -156,7 +206,12 @@ QVariant DSettingsOption::data(const QString &dataType) const
 }
 
 /*!
- * \brief UI widget type of this option
+ * \~english \brief UI widget type of this option
+ * \return
+ * \sa Dtk::Widget::DSettingsWidgetFactory
+ */
+/*!
+ * \~chinese \brief 选项的控件类型。
  * \return
  * \sa Dtk::Widget::DSettingsWidgetFactory
  */
@@ -167,9 +222,13 @@ QString DSettingsOption::viewType() const
 }
 
 /*!
- * \brief Check this option will show on DSettings dialog.
+ * \~english \brief Check this option will show on DSettings dialog.
  * \return true if option not bind to ui element.
  */
+/*!
+ * \~chinese \brief 检查选项是否会在界面上显示。
+ * \return 如果显示则返回true,否则返回false。
+ */
 bool DSettingsOption::isHidden() const
 {
     Q_D(const DSettingsOption);
@@ -177,11 +236,17 @@ bool DSettingsOption::isHidden() const
 }
 
 /*!
- * \brief Convert QJsonObject to DSettingsOption.
+ * \~english \brief Convert QJsonObject to DSettingsOption.
  * \param prefixKey instead parse prefix key from parent.
  * \param json is an QJsonObejct instance.
  * \return
  */
+/*!
+ * \~chinese \brief 从json对象中反序列化出一个选项对象。
+ * \param 选项的前缀
+ * \param 待反序列化的json对象
+ * \return
+ */
 QPointer<DSettingsOption> DSettingsOption::fromJson(const QString &prefixKey, const QJsonObject &json)
 {
     auto optionPtr = QPointer<DSettingsOption>(new DSettingsOption);
@@ -190,7 +255,11 @@ QPointer<DSettingsOption> DSettingsOption::fromJson(const QString &prefixKey, co
 }
 
 /*!
- * \brief Set current value of option
+ * \~english \brief Set current value of option.
+ * \param value
+ */
+/*!
+ * \~chinese \brief 设置选项的当前值。
  * \param value
  */
 void DSettingsOption::setValue(QVariant value)
@@ -216,11 +285,17 @@ void DSettingsOption::setValue(QVariant value)
 //}
 
 /*!
- * \brief Set custom data
+ * \~english \brief Set custom data
  * \param dataType is data id, just a unique string.
  * \param value of the data id.
  * \sa Dtk::Core::DSettingsOption::data
  */
+/*!
+ * \~chinese \brief 为选项添加自定义属性。
+ * \param dataType 选项的扎属性数据id,对每个选项必须唯一
+ * \param value 选项id对应的值
+ * \sa Dtk::Core::DSettingsOption::data
+ */
 void DSettingsOption::setData(const QString &dataType, QVariant value)
 {
     Q_D(DSettingsOption);
@@ -235,11 +310,17 @@ void DSettingsOption::setData(const QString &dataType, QVariant value)
 }
 
 /*!
- * \brief Parse QJsonObject to DSettingsOption.
+ * \~english \brief Parse QJsonObject to DSettingsOption.
  * \param prefixKey instead parse prefix key from parent.
  * \param json is an QJsonObejct instance.
  * \sa QPointer<DSettingsOption> Dtk::Core::DSettingsOption::fromJson(const QString &prefixKey, const QJsonObject &json)
  */
+/*!
+ * \~chinese \brief 从json对象中反序列化,并设置自身的值。
+ * \param 选项的前缀
+ * \param 待反序列化的json对象
+ * \sa QPointer<DSettingsOption> Dtk::Core::DSettingsOption::fromJson(const QString &prefixKey, const QJsonObject &json)
+ */
 void DSettingsOption::parseJson(const QString &prefixKey, const QJsonObject &option)
 {
     Q_D(DSettingsOption);
index 75ad2a883c45edadfd30442dca00477304f8e362..6fcf407dc7026afef7b4691678da0e1518a88439 100644 (file)
@@ -102,7 +102,11 @@ include(dtk_cmake.prf)
 include(dtk_module.prf)
 
 prf.files+= $$PWD/*.prf
-prf.path = $${QT_HOST_DATA}/mkspecs/features
+
+isEmpty(MKSPECS_INSTALL_DIR) {
+    MKSPECS_INSTALL_DIR=$${QT_HOST_DATA}/mkspecs
+}
+prf.path = $${MKSPECS_INSTALL_DIR}/features
 
 linux {
     # dtk for qmake