1 #ifndef QTMVVM_SETTINGSVIEWMODEL_H 2 #define QTMVVM_SETTINGSVIEWMODEL_H 4 #include <QtCore/qsettings.h> 5 #include <QtCore/qscopedpointer.h> 7 #include <QtMvvmCore/viewmodel.h> 8 #include <QtMvvmCore/message.h> 10 #include "QtMvvmCore/qtmvvmcore_global.h" 11 #include "QtMvvmCore/settingssetup.h" 15 class SettingsViewModelPrivate;
22 Q_PROPERTY(
bool canRestoreDefaults READ canRestoreDefaults CONSTANT)
27 Q_PROPERTY(
QtMvvm::
ISettingsSetupLoader* settingsSetupLoader READ settingsSetupLoader WRITE setSettingsSetupLoader NOTIFY settingsSetupLoaderChanged)
37 static QVariantHash showParams(
QSettings *settings, const
QString &setupFile = {});
44 virtual bool canRestoreDefaults()
const;
59 Q_INVOKABLE
virtual void saveValue(
const QString &key,
const QVariant &value);
61 Q_INVOKABLE
virtual void resetValue(
const QString &key);
65 virtual void callAction(
const QString &key,
const QVariantMap ¶meters);
75 void beginLoadSetup();
78 void onInit(
const QVariantHash ¶ms)
override;
86 #endif // QTMVVM_SETTINGSVIEWMODEL_H A ViewModel for a generic settings dialog based of an XML settings file.
A configuration for a simple dialog to be shown from the core code.
#define QTMVVM_INJECT(classType, name)
Mark a property for injection.
The base class for all viewmodels.
An interface for a generic settings setup loader.
The whole settings setup.
The primary namespace of the QtMvvm library.