#include "sampleviewmodel.h" #include #include SampleViewModel::SampleViewModel(QObject *parent) : ViewModel(parent), _model(new QtDataSync::DataStoreModel(this)) { _model->setTypeId(); } QtDataSync::DataStoreModel *SampleViewModel::model() const { return _model; } void SampleViewModel::addData(const QString &key) { _model->store()->save({key}); } void SampleViewModel::removeAt(int index) { auto mIndex = _model->index(index); if(mIndex.isValid()) _model->store()->remove(_model->object(mIndex).key); } void SampleViewModel::showSyncInfo() { show(); }