Skip to content
This repository was archived by the owner on Mar 4, 2023. It is now read-only.

Commit b61c2f3

Browse files
committed
completed datasync widgets and quick doc
1 parent 4f627c7 commit b61c2f3

File tree

9 files changed

+111
-1
lines changed

9 files changed

+111
-1
lines changed

doc/Doxyfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,11 @@ EXCLUDE = ../src/3rdparty \
908908
../src/imports/mvvmquick/OverviewListView.qml \
909909
../src/imports/mvvmquick/SectionListView.qml \
910910
../src/imports/mvvmquick/AndroidFileDialog.qml \
911-
../src/imports/mvvmquick/AndroidFolderDialog.qml
911+
../src/imports/mvvmquick/AndroidFolderDialog.qml \
912+
../src/imports/mvvmdatasyncquick/SubButton.qml \
913+
../src/imports/mvvmdatasyncquick/IdentityEditView.qml \
914+
../src/imports/mvvmdatasyncquick/ExportSetupView.qml \
915+
../src/imports/mvvmdatasyncquick/ChangeRemoteView.qml
912916

913917
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
914918
# directories that are symbolic links (a Unix file system feature) are excluded

doc/qtmvvm.dox

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,53 @@ The following list shows which classes belong to which Qt module, in alphabetica
111111

112112
<b>Current Version</b><br/>
113113
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.0
114+
115+
<b>Available Types</b>
116+
- DataSyncView
117+
- NetworkExchangeView
118+
- IdentityEditView (internal)
119+
- ExportSetupView (internal)
120+
- ChangeRemoteView (internal)
121+
*/
122+
123+
/*!
124+
@fn QtMvvm::registerDataSyncWidgets
125+
126+
You must add this method to your main.cpp in order to register all the datasync views with the
127+
WidgetsPresenter when using the widgets ui:
128+
129+
@code{.cpp}
130+
int main(int argc, char *argv[])
131+
{
132+
QApplication a(argc, argv);
133+
134+
QtMvvm::registerDataSyncWidgets();
135+
// register other stuff etc...
136+
137+
return a.exec();
138+
}
139+
@endcode
140+
141+
@sa WidgetsPresenter::registerView
142+
*/
143+
144+
/*!
145+
@fn QtMvvm::registerDataSyncQuick
146+
147+
You must add this method to your main.cpp in order to register all the datasync views with the
148+
QuickPresenter when using the quick ui:
149+
150+
@code{.cpp}
151+
int main(int argc, char *argv[])
152+
{
153+
QApplication a(argc, argv);
154+
155+
QtMvvm::registerDataSyncQuick();
156+
// register other stuff etc...
157+
158+
return a.exec();
159+
}
160+
@endcode
161+
162+
@sa QuickPresenter
114163
*/

examples/mvvmdatasyncquick/DataSyncSampleQuick/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <QtWidgets/QApplication>
22
#include <QtQml/QQmlApplicationEngine>
3+
#include <QtMvvmDataSyncQuick/qtmvvmdatasyncquick_global.h>
34

45
#include <samplecoreapp.h>
56
#include <sampleviewmodel.h>
@@ -15,6 +16,7 @@ int main(int argc, char *argv[])
1516
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
1617
QApplication app(argc, argv);
1718

19+
QtMvvm::registerDataSyncQuick();
1820
qmlRegisterUncreatableType<SampleViewModel>("de.skycoder42.QtMvvm.Sample", 1, 0, "SampleViewModel", QStringLiteral("ViewModels cannot be created"));
1921

2022
QQmlApplicationEngine engine;

src/imports/mvvmdatasyncquick/DataSyncView.qml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,29 @@ import de.skycoder42.QtMvvm.Core 1.0
88
import de.skycoder42.QtMvvm.Quick 1.0
99
import de.skycoder42.QtMvvm.DataSync.Core 1.0
1010

11+
/*! @brief The view implementation for the QtMvvm::DataSyncViewModel
12+
*
13+
* @extends QtQuick.Controls.Page
14+
*
15+
* @details This is the view used to present a datasync view model. You can extend the class
16+
* if you need to extend that view.
17+
*
18+
* @sa QtMvvm::DataSyncViewModel
19+
*/
1120
Page {
1221
id: _dataSyncView
22+
23+
/*! @brief The viewmodel to use
24+
*
25+
* @default{<i>Injected</i>}
26+
*
27+
* @accessors{
28+
* @memberAc{viewModel}
29+
* @notifyAc{viewModelChanged()}
30+
* }
31+
*
32+
* @sa QtMvvm::DataSyncViewModel
33+
*/
1334
property DataSyncViewModel viewModel: null
1435

1536
header: ContrastToolBar {

src/imports/mvvmdatasyncquick/NetworkExchangeView.qml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,29 @@ import de.skycoder42.QtMvvm.Core 1.0
88
import de.skycoder42.QtMvvm.Quick 1.0
99
import de.skycoder42.QtMvvm.DataSync.Core 1.0
1010

11+
/*! @brief The view implementation for the QtMvvm::NetworkExchangeViewModel
12+
*
13+
* @extends QtQuick.Controls.Page
14+
*
15+
* @details This is the view used to present a network exchange view model. You can extend the
16+
* class if you need to extend that view.
17+
*
18+
* @sa QtMvvm::NetworkExchangeViewModel
19+
*/
1120
Page {
1221
id: _networkExchangeView
22+
23+
/*! @brief The viewmodel to use
24+
*
25+
* @default{<i>Injected</i>}
26+
*
27+
* @accessors{
28+
* @memberAc{viewModel}
29+
* @notifyAc{viewModelChanged()}
30+
* }
31+
*
32+
* @sa QtMvvm::NetworkExchangeViewModel
33+
*/
1334
property NetworkExchangeViewModel viewModel: null
1435

1536
header: ContrastToolBar {

src/mvvmdatasyncquick/qtmvvmdatasyncquick_global.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace QtMvvm {
1313

14+
//! A method to initialize the datasync quick mvvm module
1415
Q_MVVMDATASYNCQUICK_EXPORT void registerDataSyncQuick();
1516

1617
}

src/mvvmdatasyncwidgets/datasyncwindow.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,34 @@
1212
namespace QtMvvm {
1313

1414
class DataSyncWindowPrivate;
15+
//! The widgets view implementation for the DataSyncViewModel
1516
class Q_MVVMDATASYNCWIDGETS_EXPORT DataSyncWindow : public QWidget
1617
{
1718
Q_OBJECT
1819

20+
//! A helper property to set and reset the sync progress automatically
1921
Q_PROPERTY(double syncProgress READ syncProgress WRITE setSyncProgress)
22+
//! A helper property to set the error text properly
2023
Q_PROPERTY(QString errorText READ errorText WRITE setErrorText)
2124

2225
public:
26+
//! View constructor
2327
Q_INVOKABLE explicit DataSyncWindow(QtMvvm::ViewModel *viewModel, QWidget *parent = nullptr);
2428
~DataSyncWindow();
2529

30+
//! @readAcFn{DataSyncWindow::syncProgress}
2631
double syncProgress() const;
32+
//! @readAcFn{DataSyncWindow::errorText}
2733
QString errorText() const;
2834

2935
public Q_SLOTS:
36+
//! @writeAcFn{DataSyncWindow::syncProgress}
3037
void setSyncProgress(double syncProgress);
38+
//! @writeAcFn{DataSyncWindow::errorText}
3139
void setErrorText(QString errorText);
3240

3341
protected Q_SLOTS:
42+
//! Is called by the view as soon as the viewmodel has been completly loaded
3443
virtual void viewModelReady();
3544

3645
private Q_SLOTS:

src/mvvmdatasyncwidgets/networkexchangewindow.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212
namespace QtMvvm {
1313

1414
class NetworkExchangeWindowPrivate;
15+
//! The widgets view implementation for the NetworkExchangeViewModel
1516
class Q_MVVMDATASYNCWIDGETS_EXPORT NetworkExchangeWindow : public QWidget
1617
{
1718
Q_OBJECT
1819

1920
public:
21+
//! View constructor
2022
Q_INVOKABLE explicit NetworkExchangeWindow(QtMvvm::ViewModel *viewModel, QWidget *parent = nullptr);
2123
~NetworkExchangeWindow();
2224

src/mvvmdatasyncwidgets/qtmvvmdatasyncwidgets_global.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace QtMvvm {
1313

14+
//! A method to initialize the datasync widgets mvvm module
1415
Q_MVVMDATASYNCWIDGETS_EXPORT void registerDataSyncWidgets();
1516

1617
}

0 commit comments

Comments
 (0)