<ahref="#pub-methods">Public Member Functions</a>|
<ahref="#pub-static-methods">Static Public Member Functions</a>|
<ahref="#pub-static-attribs">Static Public Attributes</a>|
<ahref="#pro-methods">Protected Member Functions</a>|
<ahref="#properties">Properties</a>|
<ahref="class_qt_mvvm_1_1_settings_view_model-members.html">List of all members</a></div>
<divclass="headertitle">
<divclass="title">QtMvvm::SettingsViewModel Class Reference</div></div>
</div><!--header-->
<divclass="contents">
<p>A <aclass="el"href="class_qt_mvvm_1_1_view_model.html"title="The base class for all viewmodels. ">ViewModel</a> for a generic settings dialog based of an XML settings file.
<areahref="class_qt_mvvm_1_1_data_sync_settings_view_model.html"title="An extension of the normal settings viewmodel with the DataSyncSettingsAccessor as accessor..."alt="QtMvvm::DataSyncSettingsViewModel"shape="rect"coords="0,168,227,192"/>
<trclass="memdesc:a3da983a9fab974d1428f757dde675945"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Is called when an action type edit is pressed. <ahref="#a3da983a9fab974d1428f757dde675945">More...</a><br/></td></tr>
<trclass="memdesc:a60149430e68d125f61841756e3cde33e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">WRITE accessor for <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#ab49fec01ec5201ceb56713525117b359"title="Holds the settings accessor used by the viewmodel to access the settings. ">SettingsViewModel::accessor</a>. <br/></td></tr>
<trclass="memdesc:a3e92e19da41a238b723424fbc4bfffea"><tdclass="mdescLeft"> </td><tdclass="mdescRight">WRITE accessor for <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#ab337aa43614ef436a173deeaa3c6c4b6"title="The settings setup loader to use to create the settings dialog. Is an injected property. ">SettingsViewModel::settingsSetupLoader</a>. <br/></td></tr>
<trclass="memdesc:a0da1ac73d99d0ddd7d22937e6c2e476d inherit pub_slots_class_qt_mvvm_1_1_view_model"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Called by the presenter when a result of a showed viewmodel is ready. <ahref="class_qt_mvvm_1_1_view_model.html#a0da1ac73d99d0ddd7d22937e6c2e476d">More...</a><br/></td></tr>
<trclass="memdesc:ad7f1915bf91612d519cc9fb997ddba3a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">NOTIFY accessor for <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#ab49fec01ec5201ceb56713525117b359"title="Holds the settings accessor used by the viewmodel to access the settings. ">SettingsViewModel::accessor</a>. <br/></td></tr>
<trclass="memdesc:a059b1c21ec43c9de21be74a0ff64993a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">NOTIFY accessor for <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#ab337aa43614ef436a173deeaa3c6c4b6"title="The settings setup loader to use to create the settings dialog. Is an injected property. ">SettingsViewModel::settingsSetupLoader</a>. <br/></td></tr>
<trclass="memdesc:a0d0326f7501dfcbcedc0611e3cec33a0"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Is emitted when the initialization has been completed and the viewmodel is ready for loading settings. <br/></td></tr>
<trclass="memdesc:a649b6e589a731d8d1ebc978818a73a4f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Signal to be emitted whenver a value in the settings is changed or removed to update the GUI. <br/></td></tr>
<trclass="memdesc:a74cfe5450367a6bf7047043ce6ee0e7b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Is emitted when the user accepted the reset triggered by <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a0aed2ae7dba7996edf4cbb30b9fbd917"title="Resets all values that are defined by the entries in the given setup. ">resetAll()</a><ahref="#a74cfe5450367a6bf7047043ce6ee0e7b">More...</a><br/></td></tr>
<trclass="inherit_header signals_class_qt_mvvm_1_1_view_model"><tdcolspan="2"onclick="javascript:toggleInherit('signals_class_qt_mvvm_1_1_view_model')"><imgsrc="closed.png"alt="-"/> Signals inherited from <aclass="el"href="class_qt_mvvm_1_1_view_model.html">QtMvvm::ViewModel</a></td></tr>
<trclass="memdesc:ac411a428c622bf6cf9b0b594de23d81f inherit signals_class_qt_mvvm_1_1_view_model"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Should be emitted when the viewmodels result is ready. <ahref="class_qt_mvvm_1_1_view_model.html#ac411a428c622bf6cf9b0b594de23d81f">More...</a><br/></td></tr>
<trclass="memdesc:aac43c9f8e10500afb8d72d6c39590d3b inherit signals_class_qt_mvvm_1_1_view_model"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Is emitted on single instance viewmodels when they get shown again. <ahref="class_qt_mvvm_1_1_view_model.html#aac43c9f8e10500afb8d72d6c39590d3b">More...</a><br/></td></tr>
<trclass="memdesc:a50fb87e02d420f9979df99b8d106745c"><tdclass="mdescLeft"> </td><tdclass="mdescRight">READ accessor for <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#ab49fec01ec5201ceb56713525117b359"title="Holds the settings accessor used by the viewmodel to access the settings. ">SettingsViewModel::accessor</a>. <br/></td></tr>
<trclass="memdesc:a1ada929c7d70e1ba7b4b67b6d247a0ca"><tdclass="mdescLeft"> </td><tdclass="mdescRight">READ accessor for <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a9f9d7222a72be5f801b24b0e49ae7b0b"title="Specifies if restoring the defaults is generally allowed. ">SettingsViewModel::canRestoreDefaults</a>. <br/></td></tr>
<trclass="memdesc:ae4be8f7e190d132625b523f5e9643127"><tdclass="mdescLeft"> </td><tdclass="mdescRight">READ accessor for <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a3ea6cee515ea7df23a78df8d7fe28f4e"title="The message configuration to be used to for a dialog to ask for settings restore. ...">SettingsViewModel::restoreConfig</a>. <br/></td></tr>
<trclass="memdesc:a987765d8734b6e8d0a591c326b890aeb"><tdclass="mdescLeft"> </td><tdclass="mdescRight">READ accessor for <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#ab337aa43614ef436a173deeaa3c6c4b6"title="The settings setup loader to use to create the settings dialog. Is an injected property. ">SettingsViewModel::settingsSetupLoader</a>. <br/></td></tr>
<trclass="memdesc:a8a51e071d8e5b5e34d6669ccfdf19160"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Loads the settings setup of the prepared file for the given frontend. <ahref="#a8a51e071d8e5b5e34d6669ccfdf19160">More...</a><br/></td></tr>
<trclass="memdesc:a05401cec1c6defbd755a5183bf8d127b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the settings this viewmodel operates on (or null if not using <aclass="el"href="class_qt_mvvm_1_1_q_settings_accessor.html"title="A settings accessor implementation that wrapps QSettings. ">QtMvvm::QSettingsAccessor</a>) <br/></td></tr>
<trclass="memdesc:a4dfa0f03d31b104f2824bddb8c94ef49"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Loads the value for the given key from the settings. <ahref="#a4dfa0f03d31b104f2824bddb8c94ef49">More...</a><br/></td></tr>
<trclass="memdesc:a30afa72fbc9fdf3ac4cd4fbf575618c2"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Saves the value with the given key. <ahref="#a30afa72fbc9fdf3ac4cd4fbf575618c2">More...</a><br/></td></tr>
<trclass="memdesc:ae6c8e4b7aac233113db630c1403567d8"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Resets the value or group identified by the key. <ahref="#ae6c8e4b7aac233113db630c1403567d8">More...</a><br/></td></tr>
<trclass="memdesc:a0aed2ae7dba7996edf4cbb30b9fbd917"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Resets all values that are defined by the entries in the given setup. <ahref="#a0aed2ae7dba7996edf4cbb30b9fbd917">More...</a><br/></td></tr>
<trclass="inherit_header pub_methods_class_qt_mvvm_1_1_view_model"><tdcolspan="2"onclick="javascript:toggleInherit('pub_methods_class_qt_mvvm_1_1_view_model')"><imgsrc="closed.png"alt="-"/> Public Member Functions inherited from <aclass="el"href="class_qt_mvvm_1_1_view_model.html">QtMvvm::ViewModel</a></td></tr>
<trclass="inherit_header pub_methods_class_q_object"><tdcolspan="2"onclick="javascript:toggleInherit('pub_methods_class_q_object')"><imgsrc="closed.png"alt="-"/> Public Member Functions inherited from <aclass="el"href="target="_blank"https://doc.qt.io/qt-5/class_q_object.html">QObject</a></td></tr>
int </td><tdclass="memItemRight"valign="bottom"><aclass="elRef"target="_blank"doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/"href="https://doc.qt.io/qt-5/qobject.html#startTimer-1">startTimer</a> (std::chrono::milliseconds time, Qt::TimerType timerType)</td></tr>
<trclass="memdesc:a746b88bdb63f89311ad7b8ca63f1f5ff"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Generates show parameter to show a settings viewmodel via <aclass="el"href="class_qt_mvvm_1_1_view_model.html#aa69782ceb2b1657f004fdfc22ea4efaa"title="Show another viewmodel as a child of this one. ">ViewModel::show</a>. <ahref="#a746b88bdb63f89311ad7b8ca63f1f5ff">More...</a><br/></td></tr>
<trclass="memdesc:a4c4aed6073b1821ba440a0cad64e27e4"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Generates show parameter to show a settings viewmodel via <aclass="el"href="class_qt_mvvm_1_1_view_model.html#aa69782ceb2b1657f004fdfc22ea4efaa"title="Show another viewmodel as a child of this one. ">ViewModel::show</a>. <ahref="#a4c4aed6073b1821ba440a0cad64e27e4">More...</a><br/></td></tr>
<trclass="inherit_header pub_static_methods_class_q_object"><tdcolspan="2"onclick="javascript:toggleInherit('pub_static_methods_class_q_object')"><imgsrc="closed.png"alt="-"/> Static Public Member Functions inherited from <aclass="el"href="target="_blank"https://doc.qt.io/qt-5/class_q_object.html">QObject</a></td></tr>
<trclass="memdesc:a4290295bdabe6916252cd4002bb0a692"><tdclass="mdescLeft"> </td><tdclass="mdescRight">The parameter for an <aclass="el"href="class_qt_mvvm_1_1_i_settings_accessor.html"title="An interface to provide a generic way to access settings of any origin. ">ISettingsAccessor</a> object for the <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a320e7141b1ca4a5fd42becd577d4683b"title="Called by the presenter to initialize the viewmodel. ">onInit()</a> method. <ahref="#a4290295bdabe6916252cd4002bb0a692">More...</a><br/></td></tr>
<trclass="memdesc:a1b031c342e3e482078512fcbd3d6244a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">The parameter for a <aclass="elRef"target="_blank"doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/"href="https://doc.qt.io/qt-5/qsettings.html">QSettings</a> object for the <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a320e7141b1ca4a5fd42becd577d4683b"title="Called by the presenter to initialize the viewmodel. ">onInit()</a> method. <ahref="#a1b031c342e3e482078512fcbd3d6244a">More...</a><br/></td></tr>
<trclass="memdesc:af66c2d1974be76419e209ed223e6f606"><tdclass="mdescLeft"> </td><tdclass="mdescRight">The parameter for a settings setup file for the <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a320e7141b1ca4a5fd42becd577d4683b"title="Called by the presenter to initialize the viewmodel. ">onInit()</a> method. <ahref="#af66c2d1974be76419e209ed223e6f606">More...</a><br/></td></tr>
<trclass="memdesc:a320e7141b1ca4a5fd42becd577d4683b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Called by the presenter to initialize the viewmodel. <ahref="#a320e7141b1ca4a5fd42becd577d4683b">More...</a><br/></td></tr>
<trclass="inherit_header pro_methods_class_qt_mvvm_1_1_view_model"><tdcolspan="2"onclick="javascript:toggleInherit('pro_methods_class_qt_mvvm_1_1_view_model')"><imgsrc="closed.png"alt="-"/> Protected Member Functions inherited from <aclass="el"href="class_qt_mvvm_1_1_view_model.html">QtMvvm::ViewModel</a></td></tr>
<trclass="memdesc:aa69782ceb2b1657f004fdfc22ea4efaa inherit pro_methods_class_qt_mvvm_1_1_view_model"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Show another viewmodel as a child of this one. <ahref="class_qt_mvvm_1_1_view_model.html#aa69782ceb2b1657f004fdfc22ea4efaa">More...</a><br/></td></tr>
<trclass="memdesc:a238c2cb9fed0e4131a7ca73033728d11 inherit pro_methods_class_qt_mvvm_1_1_view_model"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Show another viewmodel as a child of this one. <ahref="class_qt_mvvm_1_1_view_model.html#a238c2cb9fed0e4131a7ca73033728d11">More...</a><br/></td></tr>
<trclass="memdesc:a14ff0d5358f52b5a3383f1f8d3e81202 inherit pro_methods_class_qt_mvvm_1_1_view_model"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Show another viewmodel as a child of this one. <ahref="class_qt_mvvm_1_1_view_model.html#a14ff0d5358f52b5a3383f1f8d3e81202">More...</a><br/></td></tr>
<trclass="memdesc:a7a5b532fd4dfb25a01dcf8a10311ac1a inherit pro_methods_class_qt_mvvm_1_1_view_model"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Show another viewmodel as a child of this one and expect its result. <ahref="class_qt_mvvm_1_1_view_model.html#a7a5b532fd4dfb25a01dcf8a10311ac1a">More...</a><br/></td></tr>
<trclass="memdesc:a0bc3140cbd2c2dc6b40b5ca00c297a2c inherit pro_methods_class_qt_mvvm_1_1_view_model"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Show another viewmodel as a child of this one and expect its result. <ahref="class_qt_mvvm_1_1_view_model.html#a0bc3140cbd2c2dc6b40b5ca00c297a2c">More...</a><br/></td></tr>
<trclass="memdesc:a08d21a1940935bc703bcfb50dc6656e4 inherit pro_methods_class_qt_mvvm_1_1_view_model"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Show another viewmodel as a child of this one and expect its result. <ahref="class_qt_mvvm_1_1_view_model.html#a08d21a1940935bc703bcfb50dc6656e4">More...</a><br/></td></tr>
<trclass="inherit_header pro_methods_class_q_object"><tdcolspan="2"onclick="javascript:toggleInherit('pro_methods_class_q_object')"><imgsrc="closed.png"alt="-"/> Protected Member Functions inherited from <aclass="el"href="target="_blank"https://doc.qt.io/qt-5/class_q_object.html">QObject</a></td></tr>
<trclass="memdesc:ab49fec01ec5201ceb56713525117b359"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Holds the settings accessor used by the viewmodel to access the settings. <ahref="#ab49fec01ec5201ceb56713525117b359">More...</a><br/></td></tr>
<trclass="memdesc:a9f9d7222a72be5f801b24b0e49ae7b0b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Specifies if restoring the defaults is generally allowed. <ahref="#a9f9d7222a72be5f801b24b0e49ae7b0b">More...</a><br/></td></tr>
<trclass="memdesc:a3ea6cee515ea7df23a78df8d7fe28f4e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">The message configuration to be used to for a dialog to ask for settings restore. <ahref="#a3ea6cee515ea7df23a78df8d7fe28f4e">More...</a><br/></td></tr>
<trclass="memdesc:ab337aa43614ef436a173deeaa3c6c4b6"><tdclass="mdescLeft"> </td><tdclass="mdescRight">The settings setup loader to use to create the settings dialog. Is an injected property. <ahref="#ab337aa43614ef436a173deeaa3c6c4b6">More...</a><br/></td></tr>
<trclass="inherit_header properties_class_q_object"><tdcolspan="2"onclick="javascript:toggleInherit('properties_class_q_object')"><imgsrc="closed.png"alt="-"/> Properties inherited from <aclass="el"href="target="_blank"https://doc.qt.io/qt-5/class_q_object.html">QObject</a></td></tr>
<divclass="textblock"><p>A <aclass="el"href="class_qt_mvvm_1_1_view_model.html"title="The base class for all viewmodels. ">ViewModel</a> for a generic settings dialog based of an XML settings file. </p>
<p>It's a ready made viewmodel to show a settings dialog. See <aclass="el"href="settings_xml.html">The XML settings format</a>. To show the dialog, call show from another <aclass="el"href="class_qt_mvvm_1_1_view_model.html"title="The base class for all viewmodels. ">ViewModel</a> or the <aclass="el"href="class_qt_mvvm_1_1_core_app.html"title="A logicaly application object to drive the mvvm application from the core part. ">CoreApp</a>:</p>
<divclass="fragment"><divclass="line">show<QtMvvm::SettingsViewModel>();</div></div><!-- fragment --><dlclass="section see"><dt>See also</dt><dd><aclass="el"href="images_page.html">Images page</a></dd></dl>
<pclass="definition">Definition at line <aclass="el"href="settingsviewmodel_8h_source.html#l00018">18</a> of file <aclass="el"href="settingsviewmodel_8h_source.html">settingsviewmodel.h</a>.</p>
<p>Is called when an action type edit is pressed. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">key</td><td>The key of the entry that triggered the action </td></tr>
<tr><tdclass="paramname">parameters</td><td>A map with additional parameters for the action call</td></tr>
</table>
</dd>
</dl>
<p>This method is called by the GUI when an entry with the <aclass="el"href="settings_xml.html#settings_xml_types_action">action</a> type is pressed by the user. The key is what would normally be used as the settings key. The parameters are deduced from the settings XML. See the type documentation for more details.</p>
<p>If loading fails an empty setup is returned. Logging is performed internally, so you can just proceed without error checking and show an empty settings dialog. </p>
<p>You can override this method if you want to support loading and saving settings from something different than a <aclass="el"href="class_qt_mvvm_1_1_i_settings_accessor.html"title="An interface to provide a generic way to access settings of any origin. ">ISettingsAccessor</a></p>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a30afa72fbc9fdf3ac4cd4fbf575618c2"title="Saves the value with the given key. ">SettingsViewModel::saveValue</a>, <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#ae6c8e4b7aac233113db630c1403567d8"title="Resets the value or group identified by the key. ">SettingsViewModel::resetValue</a></dd></dl>
<p>Called by the presenter to initialize the viewmodel. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">params</td><td>The parameters to initialize the viewmodel with</td></tr>
</table>
</dd>
</dl>
<p>This method is called by the presenter right after creating the view and reparenting the viewmodel to the view. The parameters are the ones that have been passed to the show method called to show this viewmodel instance. Reimplement this method if you need to perform initializations after beeing assigned to a viewmodel or if you want to support a parametrized viewmodel.</p>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_view_model.html#aa69782ceb2b1657f004fdfc22ea4efaa"title="Show another viewmodel as a child of this one. ">ViewModel::show</a>, <aclass="el"href="class_qt_mvvm_1_1_view_model.html#a7a5b532fd4dfb25a01dcf8a10311ac1a"title="Show another viewmodel as a child of this one and expect its result. ">ViewModel::showForResult</a>, <aclass="el"href="class_qt_mvvm_1_1_core_app.html#a217da24a389f941bac316016928d30df"title="Show a new ViewModel by its type. ">CoreApp::show</a></dd></dl>
<p>Reimplemented in <aclass="el"href="class_qt_mvvm_1_1_data_sync_settings_view_model.html#a35be63e99cd03b98c92699692ea4d829">QtMvvm::DataSyncSettingsViewModel</a>.</p>
<p>Is emitted when the user accepted the reset triggered by <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a0aed2ae7dba7996edf4cbb30b9fbd917"title="Resets all values that are defined by the entries in the given setup. ">resetAll()</a></p>
<p>This signal is emitted as the result of a <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a0aed2ae7dba7996edf4cbb30b9fbd917"title="Resets all values that are defined by the entries in the given setup. ">resetAll()</a> that was accepted by the user. As a reaction, the settings gui implementation should close itself.</p>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a0aed2ae7dba7996edf4cbb30b9fbd917"title="Resets all values that are defined by the entries in the given setup. ">SettingsViewModel::resetAll</a></dd></dl>
<p>Resets all values that are defined by the entries in the given setup. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">setup</td><td>The setup to search for keys to be resetted</td></tr>
</table>
</dd>
</dl>
<p>You can call this method from your gui to perform a complete reset of all the settings that are visible in the gui. Internally, the method will use <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a3ea6cee515ea7df23a78df8d7fe28f4e"title="The message configuration to be used to for a dialog to ask for settings restore. ...">SettingsViewModel::restoreConfig</a> to create a dialog that asks the user for confirmation, and if he accepts, remove the value of all <aclass="el"href="namespace_qt_mvvm_1_1_settings_elements.html#struct_qt_mvvm_1_1_settings_elements_1_1_entry"title="An entry in the settings to display and edit a value. ">SettingsElements::Entry</a> elements that can be found in the setup by calling <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#ae6c8e4b7aac233113db630c1403567d8"title="Resets the value or group identified by the key. ">resetValue()</a>.</p>
<p>If the user accepted the dialog and data was successfully reset, the <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a74cfe5450367a6bf7047043ce6ee0e7b"title="Is emitted when the user accepted the reset triggered by resetAll() ">resetAccepted()</a> signal is emitted so the gui can close itself.</p>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a3ea6cee515ea7df23a78df8d7fe28f4e"title="The message configuration to be used to for a dialog to ask for settings restore. ...">SettingsViewModel::restoreConfig</a>, <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a74cfe5450367a6bf7047043ce6ee0e7b"title="Is emitted when the user accepted the reset triggered by resetAll() ">SettingsViewModel::resetAccepted</a>, <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#ae6c8e4b7aac233113db630c1403567d8"title="Resets the value or group identified by the key. ">SettingsViewModel::resetValue</a></dd></dl>
<p>You can override this method if you want to support loading and saving settings from something different than a <aclass="el"href="class_qt_mvvm_1_1_i_settings_accessor.html"title="An interface to provide a generic way to access settings of any origin. ">ISettingsAccessor</a>. if you do so, you must emit the <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a649b6e589a731d8d1ebc978818a73a4f"title="Signal to be emitted whenver a value in the settings is changed or removed to update the GUI...">valueChanged()</a> signal from this method to indicate that the data was changed.</p>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a4dfa0f03d31b104f2824bddb8c94ef49"title="Loads the value for the given key from the settings. ">SettingsViewModel::loadValue</a>, <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a30afa72fbc9fdf3ac4cd4fbf575618c2"title="Saves the value with the given key. ">SettingsViewModel::saveValue</a></dd></dl>
<p>You can override this method if you want to support loading and saving settings from something different than a <aclass="el"href="class_qt_mvvm_1_1_i_settings_accessor.html"title="An interface to provide a generic way to access settings of any origin. ">ISettingsAccessor</a>. if you do so, you must emit the <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a649b6e589a731d8d1ebc978818a73a4f"title="Signal to be emitted whenver a value in the settings is changed or removed to update the GUI...">valueChanged()</a> signal from this method to indicate that the data was changed.</p>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a4dfa0f03d31b104f2824bddb8c94ef49"title="Loads the value for the given key from the settings. ">SettingsViewModel::loadValue</a>, <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#ae6c8e4b7aac233113db630c1403567d8"title="Resets the value or group identified by the key. ">SettingsViewModel::resetValue</a></dd></dl>
<p>Generates show parameter to show a settings viewmodel via <aclass="el"href="class_qt_mvvm_1_1_view_model.html#aa69782ceb2b1657f004fdfc22ea4efaa"title="Show another viewmodel as a child of this one. ">ViewModel::show</a>. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">accessor</td><td>The <aclass="el"href="class_qt_mvvm_1_1_i_settings_accessor.html"title="An interface to provide a generic way to access settings of any origin. ">ISettingsAccessor</a> to operate on. Can be null to use the default accessor (<aclass="el"href="class_qt_mvvm_1_1_q_settings_accessor.html"title="A settings accessor implementation that wrapps QSettings. ">QSettingsAccessor</a>) </td></tr>
<tr><tdclass="paramname">setupFile</td><td>The path to a file to be used to create the settings. Can be empty to use the default path </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A paramater hash to be passed to <aclass="el"href="class_qt_mvvm_1_1_view_model.html#aa69782ceb2b1657f004fdfc22ea4efaa"title="Show another viewmodel as a child of this one. ">ViewModel::show</a></dd></dl>
<p>It's a shortcut to generate parameters for the show methods to show a settings viewmodel. Use them as:</p>
<divclass="fragment"><divclass="line">show<QtMvvm::SettingsViewModel>(<aclass="code"href="class_qt_mvvm_1_1_settings_view_model.html#a746b88bdb63f89311ad7b8ca63f1f5ff">QtMvvm::SettingsViewModel::showParams</a>(...));</div></div><!-- fragment --><dlclass="section note"><dt>Note</dt><dd>Unless you need to explicitly set the settings or setup file a normal show without any parameters will just do fine.</dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_view_model.html#aa69782ceb2b1657f004fdfc22ea4efaa"title="Show another viewmodel as a child of this one. ">ViewModel::show</a>, <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a4290295bdabe6916252cd4002bb0a692"title="The parameter for an ISettingsAccessor object for the onInit() method. ">SettingsViewModel::paramAccessor</a>, <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#af66c2d1974be76419e209ed223e6f606"title="The parameter for a settings setup file for the onInit() method. ">SettingsViewModel::paramSetupFile</a></dd></dl>
<p>Generates show parameter to show a settings viewmodel via <aclass="el"href="class_qt_mvvm_1_1_view_model.html#aa69782ceb2b1657f004fdfc22ea4efaa"title="Show another viewmodel as a child of this one. ">ViewModel::show</a>. </p>
<tr><tdclass="paramname">settings</td><td>The <aclass="elRef"target="_blank"doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/"href="https://doc.qt.io/qt-5/qsettings.html">QSettings</a> to operate on. Can be null to use the default settings </td></tr>
<tr><tdclass="paramname">setupFile</td><td>The path to a file to be used to create the settings. Can be empty to use the default path </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A paramater hash to be passed to <aclass="el"href="class_qt_mvvm_1_1_view_model.html#aa69782ceb2b1657f004fdfc22ea4efaa"title="Show another viewmodel as a child of this one. ">ViewModel::show</a></dd></dl>
<p>This internally creates a <aclass="el"href="class_qt_mvvm_1_1_q_settings_accessor.html"title="A settings accessor implementation that wrapps QSettings. ">QSettingsAccessor</a> that operates on the given settings and sets it as the <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#ab49fec01ec5201ceb56713525117b359"title="Holds the settings accessor used by the viewmodel to access the settings. ">SettingsViewModel::accessor</a>.</p>
<divclass="fragment"><divclass="line">show<QtMvvm::SettingsViewModel>(<aclass="code"href="class_qt_mvvm_1_1_settings_view_model.html#a746b88bdb63f89311ad7b8ca63f1f5ff">QtMvvm::SettingsViewModel::showParams</a>(...));</div></div><!-- fragment --><dlclass="section note"><dt>Note</dt><dd>Unless you need to explicitly set the settings or setup file a normal show without any parameters will just do fine.</dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_view_model.html#aa69782ceb2b1657f004fdfc22ea4efaa"title="Show another viewmodel as a child of this one. ">ViewModel::show</a>, <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a1b031c342e3e482078512fcbd3d6244a"title="The parameter for a QSettings object for the onInit() method. ">SettingsViewModel::paramSettings</a>, <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#af66c2d1974be76419e209ed223e6f606"title="The parameter for a settings setup file for the onInit() method. ">SettingsViewModel::paramSetupFile</a></dd></dl>
</div>
</div>
<h2class="groupheader">Member Data Documentation</h2>
<p>The parameter for an <aclass="el"href="class_qt_mvvm_1_1_i_settings_accessor.html"title="An interface to provide a generic way to access settings of any origin. ">ISettingsAccessor</a> object for the <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a320e7141b1ca4a5fd42becd577d4683b"title="Called by the presenter to initialize the viewmodel. ">onInit()</a> method. </p>
<p><b>Value:</b><code>"accessor"</code></p>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a746b88bdb63f89311ad7b8ca63f1f5ff"title="Generates show parameter to show a settings viewmodel via ViewModel::show. ">SettingsViewModel::showParams</a></dd></dl>
<pclass="definition">Definition at line <aclass="el"href="settingsviewmodel_8h_source.html#l00036">36</a> of file <aclass="el"href="settingsviewmodel_8h_source.html">settingsviewmodel.h</a>.</p>
<p>The parameter for a <aclass="elRef"target="_blank"doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/"href="https://doc.qt.io/qt-5/qsettings.html">QSettings</a> object for the <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a320e7141b1ca4a5fd42becd577d4683b"title="Called by the presenter to initialize the viewmodel. ">onInit()</a> method. </p>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a746b88bdb63f89311ad7b8ca63f1f5ff"title="Generates show parameter to show a settings viewmodel via ViewModel::show. ">SettingsViewModel::showParams</a></dd></dl>
<pclass="definition">Definition at line <aclass="el"href="settingsviewmodel_8h_source.html#l00038">38</a> of file <aclass="el"href="settingsviewmodel_8h_source.html">settingsviewmodel.h</a>.</p>
<p>The parameter for a settings setup file for the <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a320e7141b1ca4a5fd42becd577d4683b"title="Called by the presenter to initialize the viewmodel. ">onInit()</a> method. </p>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a746b88bdb63f89311ad7b8ca63f1f5ff"title="Generates show parameter to show a settings viewmodel via ViewModel::show. ">SettingsViewModel::showParams</a></dd></dl>
<pclass="definition">Definition at line <aclass="el"href="settingsviewmodel_8h_source.html#l00040">40</a> of file <aclass="el"href="settingsviewmodel_8h_source.html">settingsviewmodel.h</a>.</p>
<p>Holds the settings accessor used by the viewmodel to access the settings. </p>
<p><b>Default:</b><code>nullptr</code> (Initialized by <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a320e7141b1ca4a5fd42becd577d4683b"title="Called by the presenter to initialize the viewmodel. ">onInit()</a>) <br/>
</p>
<p>This acccessor is used by all the methods that access settings. This makes it possible to simply change the backend that the viewmodel should operate on without reimplementing it, and also makes it possible for change signals to be used to dynamically update the gui if the settings values change.</p>
<tableclass="doxtable">
<tr>
<thcolspan="2">Accessors </th></tr>
<tr>
<td><b>READ</b></td><td><aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#ab49fec01ec5201ceb56713525117b359"title="Holds the settings accessor used by the viewmodel to access the settings. ">accessor()</a></td></tr>
<tr>
<td><b>WRITE</b></td><td><aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a60149430e68d125f61841756e3cde33e"title="WRITE accessor for SettingsViewModel::accessor. ">setAccessor()</a></td></tr>
<tr>
<td><b>NOTIFY</b></td><td><aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#ad7f1915bf91612d519cc9fb997ddba3a"title="NOTIFY accessor for SettingsViewModel::accessor. ">accessorChanged()</a></td></tr>
</table>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_i_settings_accessor.html"title="An interface to provide a generic way to access settings of any origin. ">ISettingsAccessor</a>, <aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a746b88bdb63f89311ad7b8ca63f1f5ff"title="Generates show parameter to show a settings viewmodel via ViewModel::show. ">SettingsViewModel::showParams</a></dd></dl>
<pclass="definition">Definition at line <aclass="el"href="settingsviewmodel_8h_source.html#l00023">23</a> of file <aclass="el"href="settingsviewmodel_8h_source.html">settingsviewmodel.h</a>.</p>
<p>Specifies if restoring the defaults is generally allowed. </p>
<p><b>Default:</b><code>true</code><br/>
</p>
<p>Restoring defaults is only allowed if both this property and the attribute of the settings XML are true.</p>
<tableclass="doxtable">
<tr>
<thcolspan="2">Accessors </th></tr>
<tr>
<td><b>READ</b></td><td><aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a9f9d7222a72be5f801b24b0e49ae7b0b"title="Specifies if restoring the defaults is generally allowed. ">canRestoreDefaults()</a></td></tr>
<pclass="definition">Definition at line <aclass="el"href="settingsviewmodel_8h_source.html#l00026">26</a> of file <aclass="el"href="settingsviewmodel_8h_source.html">settingsviewmodel.h</a>.</p>
<p>If you want to modify the text or options, you can replace the messagebox with another dialog.</p>
<tableclass="doxtable">
<tr>
<thcolspan="2">Accessors </th></tr>
<tr>
<td><b>READ</b></td><td><aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a3ea6cee515ea7df23a78df8d7fe28f4e"title="The message configuration to be used to for a dialog to ask for settings restore. ...">restoreConfig()</a></td></tr>
<pclass="definition">Definition at line <aclass="el"href="settingsviewmodel_8h_source.html#l00028">28</a> of file <aclass="el"href="settingsviewmodel_8h_source.html">settingsviewmodel.h</a>.</p>
<p>Do not set this property yourself. It is automatically injected when showing the viewmodel. You can use the <aclass="el"href="class_qt_mvvm_1_1_service_registry.html#ab683dc8ccbb0e0198f0d5664b1f1f9ca"title="Register a service for its interface via the type. ">ServiceRegistry::registerInterface</a> if you need to use a loader different from the default one.</p>
<td><b>READ</b></td><td><aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#ab337aa43614ef436a173deeaa3c6c4b6"title="The settings setup loader to use to create the settings dialog. Is an injected property. ">settingsSetupLoader()</a></td></tr>
<tr>
<td><b>WRITE</b></td><td><aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a3e92e19da41a238b723424fbc4bfffea"title="WRITE accessor for SettingsViewModel::settingsSetupLoader. ">setSettingsSetupLoader()</a></td></tr>
<tr>
<td><b>NOTIFY</b></td><td><aclass="el"href="class_qt_mvvm_1_1_settings_view_model.html#a059b1c21ec43c9de21be74a0ff64993a"title="NOTIFY accessor for SettingsViewModel::settingsSetupLoader. ">settingsSetupLoaderChanged()</a></td></tr>
</table>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="injection_8h.html#a0a6e278ad53a06df6f32b1b636ec6151"title="Mark a property for injection. ">QTMVVM_INJECT</a></dd></dl>
<pclass="definition">Definition at line <aclass="el"href="settingsviewmodel_8h_source.html#l00031">31</a> of file <aclass="el"href="settingsviewmodel_8h_source.html">settingsviewmodel.h</a>.</p>