An interface for a generic settings setup loader. More...
#include <settingssetup.h>
Public Member Functions | |
virtual void | changeDefaultIcon (const QUrl &defaultIcon)=0 |
Can be used to overwrite the default icon for categories. More... | |
virtual SettingsElements::Setup | loadSetup (const QString &filePath, const QString &frontend, const QFileSelector *selector) const =0 |
Loads the settings setup from the given file. More... | |
An interface for a generic settings setup loader.
It is used by the SettingsViewModel to load a SettingsElements::Setup from a generic file. The default implementation that is used by default implements a loader for an XML format. You can implement your own format, but unless you need to open things other then normal files/resources (or hate XML), there is no advantage of doing so.
Definition at line 115 of file settingssetup.h.
|
pure virtual |
Can be used to overwrite the default icon for categories.
defaultIcon | The URL to the icon to use as overwrite |
The default icon used by the XML loader is qrc:/de/skycoder42/qtmvvm/icons/settings.svg
. If you want to overwrite that path (for example because you want to use a png instead of a svg icon) you can do so via this function
|
pure virtual |
Loads the settings setup from the given file.
filePath | The path to the file to be loaded |
frontend | The name of the GUI frontend beeing used |
selector | The currently active file selectors |
SettingsLoaderException | In case the loaded file is invalid |
The frontend is used to filter elements by their frontends
variable. It is always the name of the view type that is loading the settings via the viewmodel. Current values are:
widgets
for the Widgets GUIquick
for the Quick Controls 2 GUIThe selector should be used to a.) select the files to open (event the one passed). Use the select method to apply the paths. This applies for the elements as well, via the selectors
variable.