You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
615 B
33 lines
615 B
#ifndef SAMPLEVIEWMODEL_H
|
|
#define SAMPLEVIEWMODEL_H
|
|
|
|
#include <QtCore/QStringListModel>
|
|
|
|
#include <QtMvvmCore/ViewModel>
|
|
|
|
#include <QtDataSync/DataStoreModel>
|
|
|
|
#include "sampledata.h"
|
|
|
|
class SampleViewModel : public QtMvvm::ViewModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(QtDataSync::DataStoreModel* model READ model CONSTANT)
|
|
|
|
public:
|
|
Q_INVOKABLE explicit SampleViewModel(QObject *parent = nullptr);
|
|
|
|
QtDataSync::DataStoreModel* model() const;
|
|
|
|
public Q_SLOTS:
|
|
void addData(const QString &key);
|
|
void removeAt(int index);
|
|
|
|
void showSyncInfo();
|
|
|
|
private:
|
|
QtDataSync::DataStoreModel *_model;
|
|
};
|
|
|
|
#endif // SAMPLEVIEWMODEL_H
|
|
|