Skip to content

Commit ed9c9ee

Browse files
committed
completed quick doc
1 parent 17e9820 commit ed9c9ee

20 files changed

+548
-28
lines changed

doc/Doxyfile

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ ALIASES = "accessors{1}=<table><tr><th colspan= 2>Accessors</th><
274274
userAc{1}=<tr><td><b>USER</b></td><td>\1</td></tr> \
275275
"constantAc=<tr><td colspan= 2><b>CONSTANT</b></td></tr>" \
276276
"finalAc=<tr><td colspan= 2><b>FINAL</b></td></tr>" \
277+
"readonlyAc=<tr><td colspan= 2><b>READONLY</b></td></tr>" \
277278
"default{1}=<b>Default:</b> \1 <br>" \
278279
"readAcFn{1}=READ accessor for \1" \
279280
"writeAcFn{1}=WRITE accessor for \1" \
@@ -342,7 +343,7 @@ OPTIMIZE_OUTPUT_SLICE = NO
342343
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
343344
# the files are not read by doxygen.
344345

345-
EXTENSION_MAPPING =
346+
EXTENSION_MAPPING = qml=C++
346347

347348
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
348349
# according to the Markdown format, which allows for more readable
@@ -916,7 +917,8 @@ FILE_PATTERNS = *.c \
916917
*.qsf \
917918
*.as \
918919
*.js \
919-
*.qdoc
920+
*.qdoc \
921+
*.qml
920922

921923
# The RECURSIVE tag can be used to specify whether or not subdirectories should
922924
# be searched for input files as well.
@@ -934,7 +936,13 @@ RECURSIVE = YES
934936
EXCLUDE = ../src/3rdparty \
935937
../src/plugins \
936938
../src/jar \
937-
../src/translations
939+
../src/translations \
940+
../src/imports/autoupdaterquick/ProgressItem.qml \
941+
../src/imports/autoupdaterquick/UpdateInfoPage.qml \
942+
../src/imports/autoupdaterquick/SelectComponentView.qml \
943+
../src/imports/autoupdaterquick/InstallView.qml \
944+
../src/imports/autoupdaterquick/SuccessView.qml \
945+
../src/imports/autoupdaterquick/UpdateInstallerPage.qml
938946

939947
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
940948
# directories that are symbolic links (a Unix file system feature) are excluded
@@ -979,7 +987,10 @@ EXCLUDE_SYMBOLS = QtAutoUpdaterCoreDeclarativeModule \
979987
QNode \
980988
QNodeCreatedChangeBase \
981989
QPaintEngineEx \
982-
QTechniqueFilter
990+
QTechniqueFilter \
991+
DelayButton \
992+
Dialog \
993+
QtObject
983994

984995
# The EXAMPLE_PATH tag can be used to specify one or more files or directories
985996
# that contain example code fragments that are included (see the \include
@@ -1024,7 +1035,7 @@ IMAGE_PATH = ./images
10241035
# or removed, the anchors will not be placed correctly.
10251036
#
10261037
# Note that for custom extensions or not directly supported extensions you also
1027-
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
1038+
# need to set for the extension otherwise the files are not
10281039
# properly processed by doxygen.
10291040

10301041
INPUT_FILTER =
@@ -1040,7 +1051,7 @@ INPUT_FILTER =
10401051
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
10411052
# properly processed by doxygen.
10421053

1043-
FILTER_PATTERNS =
1054+
FILTER_PATTERNS = *.qml=doxyqml
10441055

10451056
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
10461057
# INPUT_FILTER) will also be used to filter the input files that are used for

doc/qtautoupdater.dox

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,25 @@ a gui and the Core-Library.
3939
- @ref QtAutoUpdater::Updater "Updater" (uncreatable)
4040
*/
4141

42+
/*!
43+
@namespace de::skycoder42::QtAutoUpdater::Quick
44+
45+
@brief The QML import for the QtAutoUpdater quick QML module
46+
47+
<b>Current Version</b><br/>
48+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.0
49+
50+
<b>Available Types</b>
51+
- Since Version 3.0
52+
- UpdateInfoModel
53+
- ProgressDialog
54+
- AskUpdateDialog
55+
- UpdateResultDialog
56+
- UpdateInfoComponent
57+
- UpdateInstallerComponent
58+
- UpdateButton
59+
*/
60+
4261
/*!
4362
@page qtautoupdater_image_page Image Page
4463

src/imports/autoupdatercore/plugins.qmltypes

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import QtQuick.tooling 1.2
99
Module {
1010
dependencies: ["QtQml 2.13", "QtQml.Models 2.13"]
1111
Component {
12-
name: "QmlAutoUpdaterSingleton"
12+
name: "QtAutoUpdater::QmlAutoUpdaterSingleton"
1313
prototype: "QObject"
1414
exports: ["de.skycoder42.QtAutoUpdater.Core/QtAutoUpdater 3.0"]
1515
isCreatable: false
@@ -61,14 +61,14 @@ Module {
6161
name: "createUpdater"
6262
type: "QtAutoUpdater::Updater*"
6363
Parameter { name: "key"; type: "string" }
64-
Parameter { name: "arguments"; type: "QVariantMap" }
64+
Parameter { name: "configuration"; type: "QVariantMap" }
6565
Parameter { name: "parent"; type: "QObject"; isPointer: true }
6666
}
6767
Method {
6868
name: "createUpdater"
6969
type: "QtAutoUpdater::Updater*"
7070
Parameter { name: "key"; type: "string" }
71-
Parameter { name: "arguments"; type: "QVariantMap" }
71+
Parameter { name: "configuration"; type: "QVariantMap" }
7272
}
7373
Method {
7474
name: "createUpdater"

src/imports/autoupdatercore/qtautoupdatercore_plugin.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <QtAutoUpdaterCore/Updater>
88

99
#include "qmlautoupdatersingleton.h"
10+
using namespace QtAutoUpdater;
1011

1112
namespace {
1213

@@ -26,10 +27,10 @@ void QtAutoUpdaterCoreDeclarativeModule::registerTypes(const char *uri)
2627
{
2728
Q_ASSERT(qstrcmp(uri, "de.skycoder42.QtAutoUpdater.Core") == 0);
2829

29-
qmlRegisterUncreatableType<QtAutoUpdater::UpdateInfo>(uri, 3, 0, "UpdateInfo", QStringLiteral("Must be created by using the QtAutoUpdater singleton"));
30-
qmlRegisterUncreatableType<QtAutoUpdater::UpdaterBackend>(uri, 3, 0, "UpdaterBackend", QStringLiteral("Cannot be created, only obtained via Updater"));
31-
qmlRegisterUncreatableType<QtAutoUpdater::UpdateInstaller>(uri, 3, 0, "UpdateInstaller", QStringLiteral("Cannot be created, only obtained via Updater"));
32-
qmlRegisterUncreatableType<QtAutoUpdater::Updater>(uri, 3, 0, "Updater", QStringLiteral("Must be created by using the QtAutoUpdater singleton"));
30+
qmlRegisterUncreatableType<UpdateInfo>(uri, 3, 0, "UpdateInfo", QStringLiteral("Must be created by using the QtAutoUpdater singleton"));
31+
qmlRegisterUncreatableType<UpdaterBackend>(uri, 3, 0, "UpdaterBackend", QStringLiteral("Cannot be created, only obtained via Updater"));
32+
qmlRegisterUncreatableType<UpdateInstaller>(uri, 3, 0, "UpdateInstaller", QStringLiteral("Cannot be created, only obtained via Updater"));
33+
qmlRegisterUncreatableType<Updater>(uri, 3, 0, "Updater", QStringLiteral("Must be created by using the QtAutoUpdater singleton"));
3334

3435
qmlRegisterSingletonType<QmlAutoUpdaterSingleton>(uri, 3, 0, "QtAutoUpdater", create_qtautoupdater);
3536

src/imports/autoupdatercore/qtautoupdatercore_plugin.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
#include <QtQml/QQmlExtensionPlugin>
55

6+
namespace QtAutoUpdater {
7+
68
class QtAutoUpdaterCoreDeclarativeModule : public QQmlExtensionPlugin
79
{
810
Q_OBJECT
@@ -13,4 +15,6 @@ class QtAutoUpdaterCoreDeclarativeModule : public QQmlExtensionPlugin
1315
void registerTypes(const char *uri) override;
1416
};
1517

18+
}
19+
1620
#endif // QTAUTOUPDATERCORE_PLUGIN_H

src/imports/autoupdaterquick/AskUpdateDialog.qml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ import QtQuick.Layouts 1.13
33
import QtQuick.Controls 2.13
44
import de.skycoder42.QtAutoUpdater.Core 3.0
55

6+
/*! @brief A dialog to ask the user whether he wants to check for updates
7+
*
8+
* You can add this dialog to your UI and connect it to an updater. When you want to check for
9+
* updates, show this dialog via open(). If the user accepts the question, the updater will
10+
* automatically start the update check
11+
*
12+
* @sa QtAutoUpdater::Updater::checkForUpdates, @ref qtautoupdater_image_page "Image Page"
13+
*/
614
DialogBase {
715
id: askDialog
816
visible: false

src/imports/autoupdaterquick/DialogBase.qml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,26 @@ import QtQuick 2.13
22
import QtQuick.Controls 2.13
33
import de.skycoder42.QtAutoUpdater.Core 3.0
44

5+
/*! @brief [INTERNAL] Base class for dialogs
6+
*
7+
* @extends QtQuick.Controls.Dialog
8+
*
9+
* @warning This class is internal and cannot be instanciated. It only exists as common base for
10+
* the other dialogs
11+
*/
512
Dialog {
613
id: dialogBase
714

15+
/*! @brief The updater to be used by the dialog
16+
*
17+
* @default{`null`}
18+
*
19+
* @accessors{
20+
* @memberAc{updater}
21+
* }
22+
*
23+
* @sa QtAutoUpdater::Updater
24+
*/
825
property Updater updater: null
926

1027
modal: true

src/imports/autoupdaterquick/ProgressDialog.qml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ import QtQuick.Layouts 1.13
33
import QtQuick.Controls 2.13
44
import de.skycoder42.QtAutoUpdater.Core 3.0
55

6+
/*! @brief A dialog to show the progress of an update check
7+
*
8+
* You can add this dialog to your UI and connect it to an updater. As soon as the updater is
9+
* checking for updates, this dialog will pop up automatically to show the progress and hide again,
10+
* once finished.
11+
*
12+
* @sa QtAutoUpdater::Updater, @ref qtautoupdater_image_page "Image Page"
13+
*/
614
DialogBase {
715
id: progressDialog
816

src/imports/autoupdaterquick/UpdateButton.qml

Lines changed: 88 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,107 @@ import QtQuick.Layouts 1.13
33
import QtQuick.Controls 2.13
44
import de.skycoder42.QtAutoUpdater.Core 3.0
55

6+
/*! @brief A simple button for update checks
7+
*
8+
* @extends QtQuick.Controls.DelayButton
9+
*
10+
* The UpdateButton is a ready-made "button" to check for updates. It is connected to an updater and
11+
* thus will automatically start checking for updates. It will also display a progress and
12+
* optionally allow canceling and installation of updates.
13+
*
14+
* The button will represent the updaters state and automatically enable/disable itself to
15+
* avoid start beeing called twice. In addition to that, the whole button item will be disabled
16+
* if the updater gets deleted while the button is still existant.
17+
*
18+
* @sa QtAutoUpdater::Updater, QtAutoUpdater::Updater::checkForUpdates,
19+
* @ref qtautoupdater_image_page "Image Page"
20+
*/
621
DelayButton {
722
id: updateButton
823

24+
//! The different modes of what text to show on the button while checking for updates
925
enum TextMode {
10-
Dynamic,
11-
Static,
12-
Cancel
26+
Dynamic, //!< If available the check status is shown as text. Otherwise same as Static
27+
Static, //!< A static "checking for updates" text is shown
28+
Cancel //!< The text shows "Cancel", and when clicked, the button will cancel the update check
1329
}
1430

31+
/*! @brief The updater to be used by the button
32+
*
33+
* @default{`null`}
34+
*
35+
* @accessors{
36+
* @memberAc{updater}
37+
* }
38+
* @sa QtAutoUpdater::Updater
39+
*/
1540
property Updater updater: null
41+
/*! @brief The text mode while checking for updates
42+
*
43+
* @default{`UpdateButton::Cancel`}
44+
*
45+
* This mode defines what the button shows and does while checking for updates. Refer to the
46+
* documentation of the enum for more details.
47+
*
48+
* @accessors{
49+
* @memberAc{textMode}
50+
* }
51+
*
52+
* @sa UpdateButton::TextMode
53+
*/
1654
property int textMode: UpdateButton.Cancel
55+
/*! @brief Specifies if the button makes it possible for the user to install updates
56+
*
57+
* @default{`true`}
58+
*
59+
* If set to true and after an update check, there are new updates, the button will show
60+
* "Install" as text and when clicked start the update installation, according to the
61+
* installMode and installScope properties via QtAutoUpdater::Updater::runUpdater().
62+
*
63+
* If set to false, the button will instead show the information, that updates are available.
64+
* If clicked again, the button simply starts another updater check
65+
*
66+
* @accessors{
67+
* @memberAc{allowInstall}
68+
* }
69+
*
70+
* @sa UpdateButton::installMode, UpdateButton::installScope, QtAutoUpdater::Updater::runUpdater
71+
*/
1772
property bool allowInstall: true
73+
/*! @brief The installation mode to be used to install updates
74+
*
75+
* @default{`Updater::InstallModeFlag::Parallel`}
76+
*
77+
* The install mode to be passed to Updater::runUpdater, if the allowInstall flag is set and the
78+
* user launches an installation via the button.
79+
*
80+
* @accessors{
81+
* @memberAc{installMode}
82+
* }
83+
*
84+
* @sa QtAutoUpdater::Updater::runUpdater, QtAutoUpdater::Updater::InstallModeFlag,
85+
* UpdateButton::installScope
86+
*/
1887
property int installMode: Updater.Parallel
88+
/*! @brief The installation scope to be used to install updates
89+
*
90+
* @default{`Updater::InstallScope::PreferInternal`}
91+
*
92+
* The install scope to be passed to Updater::runUpdater, if allowInstall is set and the user
93+
* launches an installation via the button.
94+
*
95+
* @accessors{
96+
* @memberAc{installScope}
97+
* }
98+
*
99+
* @sa QtAutoUpdater::Updater::runUpdater, QtAutoUpdater::Updater::InstallModeFlag,
100+
* UpdateButton::installMode
101+
*/
19102
property int installScope: Updater.PreferInternal
20103

104+
//! [PRIVATE PROPERTY]
21105
property real _currentProgress: -1.0
106+
//! [PRIVATE PROPERTY]
22107
property string _currentStatus
23108

24109
states: [

src/imports/autoupdaterquick/UpdateInfoComponent.qml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,45 @@
11
import QtQuick 2.13
22
import de.skycoder42.QtAutoUpdater.Core 3.0
33

4+
/*! @brief A component that creates information views with detailed infos about updates
5+
*
6+
* This class should be placed in your GUI as a view factory. It will emit the showItem() or
7+
* showComponent() signals (depending on useAsComponent) and you have to catch this signal to
8+
* actually show the created UI. The UI is a custom QQuickItem and must be shown as full screen view.
9+
*
10+
* It is internally connected to the QtAutoUpdater::Updater::checkDone() signal of the used updater
11+
* and will automatically emit the signal as soon as new updates are available.
12+
*
13+
* The following example shows how to realize this with a StackView as view container:
14+
*
15+
* @code{.qml}
16+
* StackView {
17+
* id: stackView
18+
* anchors.fill: parent // parent should be the root window
19+
* ...
20+
* }
21+
*
22+
* UpdateInfoComponent {
23+
* id: component
24+
* updater: QtAutoUpdater.createUpdater(...)
25+
* useAsComponent: true
26+
*
27+
* goBackCallback: stackView.pop
28+
* onShowItem: stackView.push(item)
29+
* }
30+
* @endcode
31+
*
32+
* @sa UpdaterComponent, UpdateResultDialog, UpdaterComponent::showItem,
33+
* UpdaterComponent::showComponent, UpdaterComponent::useAsComponent, QtQuick.Controls.StackView,
34+
* QtAutoUpdater::Updater::checkDone, @ref qtautoupdater_image_page "Image Page"
35+
*/
436
UpdaterComponent {
537
id: updateInfoComponent
638

739
viewComponent: UpdateInfoPage {
840
}
941

42+
//! [PRIVATE PROPERTY]
1043
readonly property Connections _connections: Connections {
1144
target: updater
1245

0 commit comments

Comments
 (0)