Skip to content

Commit 17e9820

Browse files
committed
added core qml doc
1 parent e9cb86c commit 17e9820

File tree

4 files changed

+83
-4
lines changed

4 files changed

+83
-4
lines changed

doc/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2202,7 +2202,7 @@ INCLUDE_FILE_PATTERNS = *.h \
22022202
# recursively expanded use the := operator instead of the = operator.
22032203
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
22042204

2205-
PREDEFINED =
2205+
PREDEFINED = DOXYGEN_RUN
22062206

22072207
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
22082208
# tag can be used to specify a list of macro names that should be expanded. The
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,23 @@ a gui and the Core-Library.
2222
- UpdateButton
2323
*/
2424

25+
/*!
26+
@namespace de::skycoder42::QtAutoUpdater::Core
27+
28+
@brief The QML import for the QtAutoUpdater core QML module
29+
30+
<b>Current Version</b><br/>
31+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.0
32+
33+
<b>Available Types</b>
34+
- Since Version 3.0
35+
- @ref de::skycoder42::QtAutoUpdater::Core::QtAutoUpdater "QtAutoUpdater" (singleton)
36+
- @ref QtAutoUpdater::UpdateInfo "UpdateInfo" (uncreatable)
37+
- @ref QtAutoUpdater::UpdaterBackend "UpdaterBackend" (uncreatable)
38+
- @ref QtAutoUpdater::UpdateInstaller "UpdateInstaller" (uncreatable)
39+
- @ref QtAutoUpdater::Updater "Updater" (uncreatable)
40+
*/
41+
2542
/*!
2643
@page qtautoupdater_image_page Image Page
2744

src/imports/autoupdatercore/qmlautoupdatersingleton.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ Updater *QmlAutoUpdaterSingleton::createUpdater(QSettings *config, QObject *pare
3737
return Updater::create(config, parent);
3838
}
3939

40-
Updater *QmlAutoUpdaterSingleton::createUpdater(QString key, QVariantMap arguments, QObject *parent) const
40+
Updater *QmlAutoUpdaterSingleton::createUpdater(QString key, QVariantMap configuration, QObject *parent) const
4141
{
42-
return Updater::create(std::move(key), std::move(arguments), parent);
42+
return Updater::create(std::move(key), std::move(configuration), parent);
4343
}
4444

4545
Updater *QmlAutoUpdaterSingleton::createUpdater(QObject *qmlConfigOrParent) const

src/imports/autoupdatercore/qmlautoupdatersingleton.h

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,85 @@
99
#include <QtAutoUpdaterCore/Updater>
1010
#include <QtAutoUpdaterCore/UpdaterBackend>
1111

12+
13+
#ifdef DOXYGEN_RUN
14+
namespace de::skycoder42::QtAutoUpdater::Core {
15+
16+
/*! @brief A singleton class to create instances of different QtAutoUpdater types
17+
*
18+
* @extends QtQml.QtObject
19+
* @since 3.0
20+
*/
21+
class QtAutoUpdater
22+
#else
23+
namespace QtAutoUpdater {
24+
1225
class QmlAutoUpdaterSingleton : public QObject
26+
#endif
1327
{
1428
Q_OBJECT
1529

1630
public:
31+
//! @private
1732
explicit QmlAutoUpdaterSingleton(QObject *parent = nullptr);
1833

34+
//! Creates a QtAutoUpdater::UpdateInfo from the given parameters
1935
Q_INVOKABLE QVariant createInfo(QVariant identifier, QString name, const QVariant &version, QVariantMap data = {}) const;
36+
//! Converts a list of QtAutoUpdater::UpdateInfos to a QVariantList, which can be consumed in QML
2037
Q_INVOKABLE QVariantList infosAsList(const QList<QtAutoUpdater::UpdateInfo> &infos) const;
2138

2239

40+
//! @copydoc QtAutoUpdater::Updater::create(const QString &, QObject*)
2341
Q_INVOKABLE QtAutoUpdater::Updater *createUpdater(const QString &configPath,
2442
QObject *parent = nullptr) const;
43+
//! @copydoc QtAutoUpdater::Updater::create(QSettings *, QObject*)
2544
Q_INVOKABLE QtAutoUpdater::Updater *createUpdater(QSettings *config,
2645
QObject *parent = nullptr) const;
46+
//! @copydoc QtAutoUpdater::Updater::create(QString, QVariantMap, QObject*)
2747
Q_INVOKABLE QtAutoUpdater::Updater *createUpdater(QString key,
28-
QVariantMap arguments,
48+
QVariantMap configuration,
2949
QObject *parent = nullptr) const;
50+
/*! @brief Creates an updater instance using the given object as either QML configuration or as parent
51+
*
52+
* @param qmlConfigOrParent The object to be consumed
53+
* @returns A newly created updater instance or `nullptr`, if unable to create one.
54+
*
55+
* The qmlConfigOrParent can be interpreted in different ways. If it is a Qt.labs.settings.Settings instance,
56+
* it is used as the configuration, but not as the parent. Otherwise it is used as the parent.
57+
*
58+
* The backend is loaded based on the given configuration. It must contain the "backend" entry, set to
59+
* the updater backend to be used. If the backend is missing or invalid, nullptr is returned. Otherwise
60+
* the created instance, initialized using the given configuration.
61+
*
62+
* @attention For some update installations, an updater needs to be launched on exit of the running
63+
* application. This only works if the updater lives long enough to catch the
64+
* QCoreApplication::aboutToQuit signal! This means when creating an updater for a backend that may need
65+
* to be run on exit, you should use either `qApp` or `nullptr` as parent for the updater.
66+
*
67+
* @sa Updater::supportedUpdaterBackends, @ref backends_TODO "Updater Backend Plugins", Qt.labs.settings.Settings
68+
*/
3069
Q_INVOKABLE QtAutoUpdater::Updater *createUpdater(QObject *qmlConfigOrParent = nullptr) const;
70+
/*! @brief Creates an updater instance using the given QML configuration and parent
71+
*
72+
* @param qmlConfig The configuration object
73+
* @param parent The object to be set as the parent for the created updater
74+
* @returns A newly created updater instance or `nullptr`, if unable to create one.
75+
*
76+
* The qmlConfig must be an instance of Qt.labs.settings.Settings or QSettings. If it is neither, no updater
77+
* can be created an nullptr gets returned
78+
*
79+
* The backend is loaded based on the given configuration. It must contain the "backend" entry, set to
80+
* the updater backend to be used. If the backend is missing or invalid, nullptr is returned. Otherwise
81+
* the created instance, initialized using the given configuration.
82+
*
83+
* @attention For some update installations, an updater needs to be launched on exit of the running
84+
* application. This only works if the updater lives long enough to catch the
85+
* QCoreApplication::aboutToQuit signal! This means when creating an updater for a backend that may need
86+
* to be run on exit, you should use either `qApp` or `nullptr` as parent for the updater.
87+
*
88+
* @sa Updater::supportedUpdaterBackends, @ref backends_TODO "Updater Backend Plugins", Qt.labs.settings.Settings,
89+
* QSettings
90+
*/
3191
Q_INVOKABLE QtAutoUpdater::Updater *createUpdater(QObject *qmlConfig,
3292
QObject *parent) const;
3393

@@ -46,4 +106,6 @@ class QmlAutoUpdaterSingleton : public QObject
46106
};
47107
};
48108

109+
}
110+
49111
#endif // QMLAUTOUPDATERSINGLETON_H

0 commit comments

Comments
 (0)