Browse Source

completed datasync widgets and quick doc

pull/2/head
Skycoder42 7 years ago
parent
commit
b61c2f3acf
No known key found for this signature in database GPG Key ID: 8E01AD9EF0578D2B
  1. 6
      doc/Doxyfile
  2. 49
      doc/qtmvvm.dox
  3. 2
      examples/mvvmdatasyncquick/DataSyncSampleQuick/main.cpp
  4. 21
      src/imports/mvvmdatasyncquick/DataSyncView.qml
  5. 21
      src/imports/mvvmdatasyncquick/NetworkExchangeView.qml
  6. 1
      src/mvvmdatasyncquick/qtmvvmdatasyncquick_global.h
  7. 9
      src/mvvmdatasyncwidgets/datasyncwindow.h
  8. 2
      src/mvvmdatasyncwidgets/networkexchangewindow.h
  9. 1
      src/mvvmdatasyncwidgets/qtmvvmdatasyncwidgets_global.h

6
doc/Doxyfile

@ -908,7 +908,11 @@ EXCLUDE = ../src/3rdparty \
../src/imports/mvvmquick/OverviewListView.qml \ ../src/imports/mvvmquick/OverviewListView.qml \
../src/imports/mvvmquick/SectionListView.qml \ ../src/imports/mvvmquick/SectionListView.qml \
../src/imports/mvvmquick/AndroidFileDialog.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 # 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 # directories that are symbolic links (a Unix file system feature) are excluded

49
doc/qtmvvm.dox

@ -111,4 +111,53 @@ The following list shows which classes belong to which Qt module, in alphabetica
<b>Current Version</b><br/> <b>Current Version</b><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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
*/ */

2
examples/mvvmdatasyncquick/DataSyncSampleQuick/main.cpp

@ -1,5 +1,6 @@
#include <QtWidgets/QApplication> #include <QtWidgets/QApplication>
#include <QtQml/QQmlApplicationEngine> #include <QtQml/QQmlApplicationEngine>
#include <QtMvvmDataSyncQuick/qtmvvmdatasyncquick_global.h>
#include <samplecoreapp.h> #include <samplecoreapp.h>
#include <sampleviewmodel.h> #include <sampleviewmodel.h>
@ -15,6 +16,7 @@ int main(int argc, char *argv[])
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv); QApplication app(argc, argv);
QtMvvm::registerDataSyncQuick();
qmlRegisterUncreatableType<SampleViewModel>("de.skycoder42.QtMvvm.Sample", 1, 0, "SampleViewModel", QStringLiteral("ViewModels cannot be created")); qmlRegisterUncreatableType<SampleViewModel>("de.skycoder42.QtMvvm.Sample", 1, 0, "SampleViewModel", QStringLiteral("ViewModels cannot be created"));
QQmlApplicationEngine engine; QQmlApplicationEngine engine;

21
src/imports/mvvmdatasyncquick/DataSyncView.qml

@ -8,8 +8,29 @@ import de.skycoder42.QtMvvm.Core 1.0
import de.skycoder42.QtMvvm.Quick 1.0 import de.skycoder42.QtMvvm.Quick 1.0
import de.skycoder42.QtMvvm.DataSync.Core 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 { Page {
id: _dataSyncView id: _dataSyncView
/*! @brief The viewmodel to use
*
* @default{<i>Injected</i>}
*
* @accessors{
* @memberAc{viewModel}
* @notifyAc{viewModelChanged()}
* }
*
* @sa QtMvvm::DataSyncViewModel
*/
property DataSyncViewModel viewModel: null property DataSyncViewModel viewModel: null
header: ContrastToolBar { header: ContrastToolBar {

21
src/imports/mvvmdatasyncquick/NetworkExchangeView.qml

@ -8,8 +8,29 @@ import de.skycoder42.QtMvvm.Core 1.0
import de.skycoder42.QtMvvm.Quick 1.0 import de.skycoder42.QtMvvm.Quick 1.0
import de.skycoder42.QtMvvm.DataSync.Core 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 { Page {
id: _networkExchangeView id: _networkExchangeView
/*! @brief The viewmodel to use
*
* @default{<i>Injected</i>}
*
* @accessors{
* @memberAc{viewModel}
* @notifyAc{viewModelChanged()}
* }
*
* @sa QtMvvm::NetworkExchangeViewModel
*/
property NetworkExchangeViewModel viewModel: null property NetworkExchangeViewModel viewModel: null
header: ContrastToolBar { header: ContrastToolBar {

1
src/mvvmdatasyncquick/qtmvvmdatasyncquick_global.h

@ -11,6 +11,7 @@
namespace QtMvvm { namespace QtMvvm {
//! A method to initialize the datasync quick mvvm module
Q_MVVMDATASYNCQUICK_EXPORT void registerDataSyncQuick(); Q_MVVMDATASYNCQUICK_EXPORT void registerDataSyncQuick();
} }

9
src/mvvmdatasyncwidgets/datasyncwindow.h

@ -12,25 +12,34 @@
namespace QtMvvm { namespace QtMvvm {
class DataSyncWindowPrivate; class DataSyncWindowPrivate;
//! The widgets view implementation for the DataSyncViewModel
class Q_MVVMDATASYNCWIDGETS_EXPORT DataSyncWindow : public QWidget class Q_MVVMDATASYNCWIDGETS_EXPORT DataSyncWindow : public QWidget
{ {
Q_OBJECT Q_OBJECT
//! A helper property to set and reset the sync progress automatically
Q_PROPERTY(double syncProgress READ syncProgress WRITE setSyncProgress) 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) Q_PROPERTY(QString errorText READ errorText WRITE setErrorText)
public: public:
//! View constructor
Q_INVOKABLE explicit DataSyncWindow(QtMvvm::ViewModel *viewModel, QWidget *parent = nullptr); Q_INVOKABLE explicit DataSyncWindow(QtMvvm::ViewModel *viewModel, QWidget *parent = nullptr);
~DataSyncWindow(); ~DataSyncWindow();
//! @readAcFn{DataSyncWindow::syncProgress}
double syncProgress() const; double syncProgress() const;
//! @readAcFn{DataSyncWindow::errorText}
QString errorText() const; QString errorText() const;
public Q_SLOTS: public Q_SLOTS:
//! @writeAcFn{DataSyncWindow::syncProgress}
void setSyncProgress(double syncProgress); void setSyncProgress(double syncProgress);
//! @writeAcFn{DataSyncWindow::errorText}
void setErrorText(QString errorText); void setErrorText(QString errorText);
protected Q_SLOTS: protected Q_SLOTS:
//! Is called by the view as soon as the viewmodel has been completly loaded
virtual void viewModelReady(); virtual void viewModelReady();
private Q_SLOTS: private Q_SLOTS:

2
src/mvvmdatasyncwidgets/networkexchangewindow.h

@ -12,11 +12,13 @@
namespace QtMvvm { namespace QtMvvm {
class NetworkExchangeWindowPrivate; class NetworkExchangeWindowPrivate;
//! The widgets view implementation for the NetworkExchangeViewModel
class Q_MVVMDATASYNCWIDGETS_EXPORT NetworkExchangeWindow : public QWidget class Q_MVVMDATASYNCWIDGETS_EXPORT NetworkExchangeWindow : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
//! View constructor
Q_INVOKABLE explicit NetworkExchangeWindow(QtMvvm::ViewModel *viewModel, QWidget *parent = nullptr); Q_INVOKABLE explicit NetworkExchangeWindow(QtMvvm::ViewModel *viewModel, QWidget *parent = nullptr);
~NetworkExchangeWindow(); ~NetworkExchangeWindow();

1
src/mvvmdatasyncwidgets/qtmvvmdatasyncwidgets_global.h

@ -11,6 +11,7 @@
namespace QtMvvm { namespace QtMvvm {
//! A method to initialize the datasync widgets mvvm module
Q_MVVMDATASYNCWIDGETS_EXPORT void registerDataSyncWidgets(); Q_MVVMDATASYNCWIDGETS_EXPORT void registerDataSyncWidgets();
} }

Loading…
Cancel
Save