Browse Source
completed datasync widgets and quick doc
pull/2/head
Skycoder42
7 years ago
No known key found for this signature in database
GPG Key ID: 8E01AD9EF0578D2B
9 changed files with
111 additions and
1 deletions
-
doc/Doxyfile
-
doc/qtmvvm.dox
-
examples/mvvmdatasyncquick/DataSyncSampleQuick/main.cpp
-
src/imports/mvvmdatasyncquick/DataSyncView.qml
-
src/imports/mvvmdatasyncquick/NetworkExchangeView.qml
-
src/mvvmdatasyncquick/qtmvvmdatasyncquick_global.h
-
src/mvvmdatasyncwidgets/datasyncwindow.h
-
src/mvvmdatasyncwidgets/networkexchangewindow.h
-
src/mvvmdatasyncwidgets/qtmvvmdatasyncwidgets_global.h
|
|
@ -908,7 +908,11 @@ EXCLUDE = ../src/3rdparty \ |
|
|
|
../src/imports/mvvmquick/OverviewListView.qml \ |
|
|
|
../src/imports/mvvmquick/SectionListView.qml \ |
|
|
|
../src/imports/mvvmquick/AndroidFileDialog.qml \ |
|
|
|
../src/imports/mvvmquick/AndroidFolderDialog.qml |
|
|
|
../src/imports/mvvmquick/AndroidFolderDialog.qml \ |
|
|
|
../src/imports/mvvmdatasyncquick/SubButton.qml \ |
|
|
|
../src/imports/mvvmdatasyncquick/IdentityEditView.qml \ |
|
|
|
../src/imports/mvvmdatasyncquick/ExportSetupView.qml \ |
|
|
|
../src/imports/mvvmdatasyncquick/ChangeRemoteView.qml |
|
|
|
|
|
|
|
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or |
|
|
|
# directories that are symbolic links (a Unix file system feature) are excluded |
|
|
|
|
|
@ -111,4 +111,53 @@ The following list shows which classes belong to which Qt module, in alphabetica |
|
|
|
|
|
|
|
<b>Current Version</b><br/> |
|
|
|
1.0 |
|
|
|
|
|
|
|
<b>Available Types</b> |
|
|
|
- DataSyncView |
|
|
|
- NetworkExchangeView |
|
|
|
- IdentityEditView (internal) |
|
|
|
- ExportSetupView (internal) |
|
|
|
- ChangeRemoteView (internal) |
|
|
|
*/ |
|
|
|
|
|
|
|
/*! |
|
|
|
@fn QtMvvm::registerDataSyncWidgets |
|
|
|
|
|
|
|
You must add this method to your main.cpp in order to register all the datasync views with the |
|
|
|
WidgetsPresenter when using the widgets ui: |
|
|
|
|
|
|
|
@code{.cpp} |
|
|
|
int main(int argc, char *argv[]) |
|
|
|
{ |
|
|
|
QApplication a(argc, argv); |
|
|
|
|
|
|
|
QtMvvm::registerDataSyncWidgets(); |
|
|
|
// register other stuff etc... |
|
|
|
|
|
|
|
return a.exec(); |
|
|
|
} |
|
|
|
@endcode |
|
|
|
|
|
|
|
@sa WidgetsPresenter::registerView |
|
|
|
*/ |
|
|
|
|
|
|
|
/*! |
|
|
|
@fn QtMvvm::registerDataSyncQuick |
|
|
|
|
|
|
|
You must add this method to your main.cpp in order to register all the datasync views with the |
|
|
|
QuickPresenter when using the quick ui: |
|
|
|
|
|
|
|
@code{.cpp} |
|
|
|
int main(int argc, char *argv[]) |
|
|
|
{ |
|
|
|
QApplication a(argc, argv); |
|
|
|
|
|
|
|
QtMvvm::registerDataSyncQuick(); |
|
|
|
// register other stuff etc... |
|
|
|
|
|
|
|
return a.exec(); |
|
|
|
} |
|
|
|
@endcode |
|
|
|
|
|
|
|
@sa QuickPresenter |
|
|
|
*/ |
|
|
|
|
|
@ -1,5 +1,6 @@ |
|
|
|
#include <QtWidgets/QApplication> |
|
|
|
#include <QtQml/QQmlApplicationEngine> |
|
|
|
#include <QtMvvmDataSyncQuick/qtmvvmdatasyncquick_global.h> |
|
|
|
|
|
|
|
#include <samplecoreapp.h> |
|
|
|
#include <sampleviewmodel.h> |
|
|
@ -15,6 +16,7 @@ int main(int argc, char *argv[]) |
|
|
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); |
|
|
|
QApplication app(argc, argv); |
|
|
|
|
|
|
|
QtMvvm::registerDataSyncQuick(); |
|
|
|
qmlRegisterUncreatableType<SampleViewModel>("de.skycoder42.QtMvvm.Sample", 1, 0, "SampleViewModel", QStringLiteral("ViewModels cannot be created")); |
|
|
|
|
|
|
|
QQmlApplicationEngine engine; |
|
|
|
|
|
@ -8,8 +8,29 @@ import de.skycoder42.QtMvvm.Core 1.0 |
|
|
|
import de.skycoder42.QtMvvm.Quick 1.0 |
|
|
|
import de.skycoder42.QtMvvm.DataSync.Core 1.0 |
|
|
|
|
|
|
|
/*! @brief The view implementation for the QtMvvm::DataSyncViewModel |
|
|
|
* |
|
|
|
* @extends QtQuick.Controls.Page |
|
|
|
* |
|
|
|
* @details This is the view used to present a datasync view model. You can extend the class |
|
|
|
* if you need to extend that view. |
|
|
|
* |
|
|
|
* @sa QtMvvm::DataSyncViewModel |
|
|
|
*/ |
|
|
|
Page { |
|
|
|
id: _dataSyncView |
|
|
|
|
|
|
|
/*! @brief The viewmodel to use |
|
|
|
* |
|
|
|
* @default{<i>Injected</i>} |
|
|
|
* |
|
|
|
* @accessors{ |
|
|
|
* @memberAc{viewModel} |
|
|
|
* @notifyAc{viewModelChanged()} |
|
|
|
* } |
|
|
|
* |
|
|
|
* @sa QtMvvm::DataSyncViewModel |
|
|
|
*/ |
|
|
|
property DataSyncViewModel viewModel: null |
|
|
|
|
|
|
|
header: ContrastToolBar { |
|
|
|
|
|
@ -8,8 +8,29 @@ import de.skycoder42.QtMvvm.Core 1.0 |
|
|
|
import de.skycoder42.QtMvvm.Quick 1.0 |
|
|
|
import de.skycoder42.QtMvvm.DataSync.Core 1.0 |
|
|
|
|
|
|
|
/*! @brief The view implementation for the QtMvvm::NetworkExchangeViewModel |
|
|
|
* |
|
|
|
* @extends QtQuick.Controls.Page |
|
|
|
* |
|
|
|
* @details This is the view used to present a network exchange view model. You can extend the |
|
|
|
* class if you need to extend that view. |
|
|
|
* |
|
|
|
* @sa QtMvvm::NetworkExchangeViewModel |
|
|
|
*/ |
|
|
|
Page { |
|
|
|
id: _networkExchangeView |
|
|
|
|
|
|
|
/*! @brief The viewmodel to use |
|
|
|
* |
|
|
|
* @default{<i>Injected</i>} |
|
|
|
* |
|
|
|
* @accessors{ |
|
|
|
* @memberAc{viewModel} |
|
|
|
* @notifyAc{viewModelChanged()} |
|
|
|
* } |
|
|
|
* |
|
|
|
* @sa QtMvvm::NetworkExchangeViewModel |
|
|
|
*/ |
|
|
|
property NetworkExchangeViewModel viewModel: null |
|
|
|
|
|
|
|
header: ContrastToolBar { |
|
|
|
|
|
@ -11,6 +11,7 @@ |
|
|
|
|
|
|
|
namespace QtMvvm { |
|
|
|
|
|
|
|
//! A method to initialize the datasync quick mvvm module
|
|
|
|
Q_MVVMDATASYNCQUICK_EXPORT void registerDataSyncQuick(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
@ -12,25 +12,34 @@ |
|
|
|
namespace QtMvvm { |
|
|
|
|
|
|
|
class DataSyncWindowPrivate; |
|
|
|
//! The widgets view implementation for the DataSyncViewModel
|
|
|
|
class Q_MVVMDATASYNCWIDGETS_EXPORT DataSyncWindow : public QWidget |
|
|
|
{ |
|
|
|
Q_OBJECT |
|
|
|
|
|
|
|
//! A helper property to set and reset the sync progress automatically
|
|
|
|
Q_PROPERTY(double syncProgress READ syncProgress WRITE setSyncProgress) |
|
|
|
//! A helper property to set the error text properly
|
|
|
|
Q_PROPERTY(QString errorText READ errorText WRITE setErrorText) |
|
|
|
|
|
|
|
public: |
|
|
|
//! View constructor
|
|
|
|
Q_INVOKABLE explicit DataSyncWindow(QtMvvm::ViewModel *viewModel, QWidget *parent = nullptr); |
|
|
|
~DataSyncWindow(); |
|
|
|
|
|
|
|
//! @readAcFn{DataSyncWindow::syncProgress}
|
|
|
|
double syncProgress() const; |
|
|
|
//! @readAcFn{DataSyncWindow::errorText}
|
|
|
|
QString errorText() const; |
|
|
|
|
|
|
|
public Q_SLOTS: |
|
|
|
//! @writeAcFn{DataSyncWindow::syncProgress}
|
|
|
|
void setSyncProgress(double syncProgress); |
|
|
|
//! @writeAcFn{DataSyncWindow::errorText}
|
|
|
|
void setErrorText(QString errorText); |
|
|
|
|
|
|
|
protected Q_SLOTS: |
|
|
|
//! Is called by the view as soon as the viewmodel has been completly loaded
|
|
|
|
virtual void viewModelReady(); |
|
|
|
|
|
|
|
private Q_SLOTS: |
|
|
|
|
|
@ -12,11 +12,13 @@ |
|
|
|
namespace QtMvvm { |
|
|
|
|
|
|
|
class NetworkExchangeWindowPrivate; |
|
|
|
//! The widgets view implementation for the NetworkExchangeViewModel
|
|
|
|
class Q_MVVMDATASYNCWIDGETS_EXPORT NetworkExchangeWindow : public QWidget |
|
|
|
{ |
|
|
|
Q_OBJECT |
|
|
|
|
|
|
|
public: |
|
|
|
//! View constructor
|
|
|
|
Q_INVOKABLE explicit NetworkExchangeWindow(QtMvvm::ViewModel *viewModel, QWidget *parent = nullptr); |
|
|
|
~NetworkExchangeWindow(); |
|
|
|
|
|
|
|
|
|
@ -11,6 +11,7 @@ |
|
|
|
|
|
|
|
namespace QtMvvm { |
|
|
|
|
|
|
|
//! A method to initialize the datasync widgets mvvm module
|
|
|
|
Q_MVVMDATASYNCWIDGETS_EXPORT void registerDataSyncWidgets(); |
|
|
|
|
|
|
|
} |
|
|
|