<ahref="#pub-methods">Public Member Functions</a>|
<ahref="#pub-static-methods">Static Public Member Functions</a>|
<ahref="#pro-methods">Protected Member Functions</a>|
<ahref="#properties">Properties</a>|
<ahref="class_qt_mvvm_1_1_widgets_presenter-members.html">List of all members</a></div>
<divclass="headertitle">
<divclass="title">QtMvvm::WidgetsPresenter Class Reference</div></div>
</div><!--header-->
<divclass="contents">
<p>The <aclass="el"href="class_qt_mvvm_1_1_i_presenter.html"title="The interface for a GUI view presenter. ">IPresenter</a> implementation for the widgets module.
<areahref="class_qt_mvvm_1_1_i_presenter.html"title="The interface for a GUI view presenter. "alt="QtMvvm::IPresenter"shape="rect"coords="174,0,338,24"/>
<trclass="memdesc:a77e042c6ebe285bd6fc26a3a0d58534f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">WRITE accessor for <aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a8d7ca39d6041fe36b5fd620ff3fc13f4"title="The factory to create input widgets with, as injected property. ">WidgetsPresenter::inputWidgetFactory</a>. <br/></td></tr>
<trclass="memdesc:af669b0161a6a7d26d723ff1bd7a0b552"><tdclass="mdescLeft"> </td><tdclass="mdescRight">NOTIFY accessor for <aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a8d7ca39d6041fe36b5fd620ff3fc13f4"title="The factory to create input widgets with, as injected property. ">WidgetsPresenter::inputWidgetFactory</a>. <br/></td></tr>
<trclass="memdesc:a4f4d51ec8d0dcfa190ee813937aa0166"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Called to present a viewmodel. <ahref="#a4f4d51ec8d0dcfa190ee813937aa0166">More...</a><br/></td></tr>
<trclass="memdesc:a4766ec05cd6999ee16505d472e48adf9"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Called to present a dialog via a message config. <ahref="#a4766ec05cd6999ee16505d472e48adf9">More...</a><br/></td></tr>
<trclass="memdesc:abf9491cfcc65f716e16251f2dda8f6e3"><tdclass="mdescLeft"> </td><tdclass="mdescRight">READ accessor for <aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a8d7ca39d6041fe36b5fd620ff3fc13f4"title="The factory to create input widgets with, as injected property. ">WidgetsPresenter::inputWidgetFactory</a>. <br/></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:a9d707a6c2003469d6d62d5370356f515"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Register a subclass of the <aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html"title="The IPresenter implementation for the widgets module. ">WidgetsPresenter</a> as the active presenter for 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>. <br/></td></tr>
<trclass="memdesc:a0b665bb6c87884d5789f616814c80cf6"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Register a view to be found by the presenter. <ahref="#a0b665bb6c87884d5789f616814c80cf6">More...</a><br/></td></tr>
<trclass="memdesc:a2203a955a03770a6c877cbc54050cb97"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Register a view to be found by the presenter. <ahref="#a2203a955a03770a6c877cbc54050cb97">More...</a><br/></td></tr>
<trclass="memdesc:a3ff4fc6783162f3d9e8895d025e949c5"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Register a view for a viewmodel to be found by the presenter. <ahref="#a3ff4fc6783162f3d9e8895d025e949c5">More...</a><br/></td></tr>
<trclass="memdesc:abca0029daffb05a12f28f2594a0c023f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Register a view for a viewmodel to be found by the presenter. <ahref="#abca0029daffb05a12f28f2594a0c023f">More...</a><br/></td></tr>
<trclass="memdesc:afd96ada3af82e56c014ed647172dd700"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the internally used input widget factory. <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:aa0813481dc8d752fd2d8bca9495bb998"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Is called to find the meta object of the view to be used for the given viewmodel. <ahref="#aa0813481dc8d752fd2d8bca9495bb998">More...</a><br/></td></tr>
<trclass="memdesc:a5e2f5776adff5584c1572e55b9fefd73"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Try to present the given view on the parent view. <ahref="#a5e2f5776adff5584c1572e55b9fefd73">More...</a><br/></td></tr>
<trclass="memdesc:a2a2d1c292c4117b542a7a610709b2a17"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Called to show a widget in the foreground. <ahref="#a2a2d1c292c4117b542a7a610709b2a17">More...</a><br/></td></tr>
<trclass="memdesc:a33697bcd5ead0a2a1ac3f63c59fdfd2f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Called to present a dialog of <aclass="el"href="class_qt_mvvm_1_1_message_config.html#a4bf2b7c1738a86009303fbb07dcad08c"title="A type to show a standard message box. ">MessageConfig::TypeMessageBox</a>. <ahref="#a33697bcd5ead0a2a1ac3f63c59fdfd2f">More...</a><br/></td></tr>
<trclass="memdesc:a18f10dbe6ed65ef932e7e9ec3b2e7ed5"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Called to present a dialog of <aclass="el"href="class_qt_mvvm_1_1_message_config.html#ae80918dc646fe89d59a1ddfed729d1b7"title="A type to show a generic input dialog. ">MessageConfig::TypeInputDialog</a>. <ahref="#a18f10dbe6ed65ef932e7e9ec3b2e7ed5">More...</a><br/></td></tr>
<trclass="memdesc:af85b64638d159a4d48be42ae332dc821"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Called to present a dialog of <aclass="el"href="class_qt_mvvm_1_1_message_config.html#a4e605350d96923e7bdf000388fc514f5"title="A type to show a generic file dialog. ">MessageConfig::TypeFileDialog</a>. <ahref="#af85b64638d159a4d48be42ae332dc821">More...</a><br/></td></tr>
<trclass="memdesc:ae03aaaba667e8145ab4430f024036ced"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Called to present a dialog of <aclass="el"href="class_qt_mvvm_1_1_message_config.html#a52011f5904343e09758633a77ea8d2f2"title="A type to show a generic color dialog. ">MessageConfig::TypeColorDialog</a>. <br/></td></tr>
<trclass="memdesc:aad18aedf30eca09222289540e7452b33"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Called to present a dialog of <aclass="el"href="class_qt_mvvm_1_1_message_config.html#a10a4630967ff5b75caf06f6e1157b7e6"title="A type to show a generic progress dialog. ">MessageConfig::TypeProgressDialog</a>. <br/></td></tr>
<trclass="memdesc:a39d8182714fc1a0693129f30d20a4ae1"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Called to present a dialog of a non standard <aclass="el"href="class_qt_mvvm_1_1_message_config.html#a8ddd0717a5f8a07f520df25743ded0da"title="The general type of dialog to be shown. ">MessageConfig::type</a>. <ahref="#a39d8182714fc1a0693129f30d20a4ae1">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="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>The <aclass="el"href="class_qt_mvvm_1_1_i_presenter.html"title="The interface for a GUI view presenter. ">IPresenter</a> implementation for the widgets module. </p>
<p>This presenter is automatically registered as the default presenter for the <aclass="el"href="class_qt_mvvm_1_1_i_presenter.html"title="The interface for a GUI view presenter. ">IPresenter</a> interface with the <aclass="el"href="class_qt_mvvm_1_1_service_registry.html"title="A singleton to prepare services for dependency injection and to access them. ">ServiceRegistry</a>, but as weak service, in order to make it possible to overwrite it.</p>
<p>The class handles all the logic required for presenting widget based views. You can extend this class and reimplement it's virtual methods if you need to adjust how certain views or dialogs are presented, or if you want to support custom stuff </p>
<pclass="definition">Definition at line <aclass="el"href="widgetspresenter_8h_source.html#l00019">19</a> of file <aclass="el"href="widgetspresenter_8h_source.html">widgetspresenter.h</a>.</p>
</div><h2class="groupheader">Member Function Documentation</h2>
<p>Is called to find the meta object of the view to be used for the given viewmodel. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">viewModelMetaObject</td><td>The metobject of the viewmodel to find a view for </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The metaobject of the view to used, or <code>nullptr</code> if none was found </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="class_qt_mvvm_1_1_presenter_exception.html"title="An exception to be thrown from the presenter if presenting fails. ">PresenterException</a></td><td>If no view could be found</td></tr>
</table>
</dd>
</dl>
<p>The default implementation simply check all explicitly registered views and then tries to match the name with the implicitly registered ones. If no match if found, the same is tried for the parent viewmodel type recursively, until the <aclass="el"href="class_qt_mvvm_1_1_view_model.html"title="The base class for all viewmodels. ">ViewModel</a> base is reached. </p>
<tr><tdclass="paramname">viewModel</td><td>The <aclass="el"href="class_qt_mvvm_1_1_view_model.html"title="The base class for all viewmodels. ">ViewModel</a> to be presenter </td></tr>
<tr><tdclass="paramname">params</td><td>Additional parameters for the viemodel initialization </td></tr>
<tr><tdclass="paramname">parent</td><td>An optional parent for the viewmodels view </td></tr>
</table>
</dd>
</dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="class_qt_mvvm_1_1_presenter_exception.html"title="An exception to be thrown from the presenter if presenting fails. ">PresenterException</a></td><td>When presenting fails for whatever reason</td></tr>
</table>
</dd>
</dl>
<p>This method should:</p>
<oltype="1">
<li>Find and create a view for the viewmodel</li>
<li>Use the view of the parent viewModel to make the new view a child of that parent view</li>
<li>Make the viewmodel a child of the view (via <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#setParent">QObject::setParent</a>)</li>
<li>Call the viewmodels <aclass="el"href="class_qt_mvvm_1_1_view_model.html#aed696c49a28b9615d3433c6a27006c70"title="Called by the presenter to initialize the viewmodel. ">ViewModel::onInit</a> method with the given parameters</li>
<li>Find a presentation method for the view (based on the view/viewmodel and/or parent)</li>
<li>Show the view to the user</li>
</ol>
<p>If this method returns it is assumed the presentation was successful. If you throw the exception, presenting has failed, and the app will automatically destroy the viewmodel and handle cleanups and results.</p>
<dlclass="section note"><dt>Note</dt><dd>If you need to present asynchronous, then you need to perform this step yourself in case the asynchronous presentation failed.</dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_i_presenter.html#a6e2921a23d4a8513a80526141f79b4d1"title="Called to present a dialog via a message config. ">IPresenter::showDialog</a></dd></dl>
<p>Called to present a dialog of <aclass="el"href="class_qt_mvvm_1_1_message_config.html#a4e605350d96923e7bdf000388fc514f5"title="A type to show a generic file dialog. ">MessageConfig::TypeFileDialog</a>. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">config</td><td>The configuration of the file dialog </td></tr>
<tr><tdclass="paramname">result</td><td>The message result to report the result to </td></tr>
</table>
</dd>
</dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="class_qt_mvvm_1_1_presenter_exception.html"title="An exception to be thrown from the presenter if presenting fails. ">PresenterException</a></td><td>If presenting the dialog failed</td></tr>
</table>
</dd>
</dl>
<p>This method is called by <aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a4766ec05cd6999ee16505d472e48adf9"title="Called to present a dialog via a message config. ">showDialog()</a> to present a dialog from a message config with the <aclass="el"href="class_qt_mvvm_1_1_message_config.html#a8ddd0717a5f8a07f520df25743ded0da"title="The general type of dialog to be shown. ">MessageConfig::type</a> set to <aclass="el"href="class_qt_mvvm_1_1_message_config.html#a4e605350d96923e7bdf000388fc514f5"title="A type to show a generic file dialog. ">MessageConfig::TypeFileDialog</a>. You can override it to customize how to show them.</p>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a4766ec05cd6999ee16505d472e48adf9"title="Called to present a dialog via a message config. ">WidgetsPresenter::showDialog</a></dd></dl>
<p>Called to present a dialog of <aclass="el"href="class_qt_mvvm_1_1_message_config.html#ae80918dc646fe89d59a1ddfed729d1b7"title="A type to show a generic input dialog. ">MessageConfig::TypeInputDialog</a>. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">config</td><td>The configuration of the input dialog </td></tr>
<tr><tdclass="paramname">result</td><td>The message result to report the result to </td></tr>
</table>
</dd>
</dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="class_qt_mvvm_1_1_presenter_exception.html"title="An exception to be thrown from the presenter if presenting fails. ">PresenterException</a></td><td>If presenting the dialog failed</td></tr>
</table>
</dd>
</dl>
<p>This method is called by <aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a4766ec05cd6999ee16505d472e48adf9"title="Called to present a dialog via a message config. ">showDialog()</a> to present a dialog from a message config with the <aclass="el"href="class_qt_mvvm_1_1_message_config.html#a8ddd0717a5f8a07f520df25743ded0da"title="The general type of dialog to be shown. ">MessageConfig::type</a> set to <aclass="el"href="class_qt_mvvm_1_1_message_config.html#ae80918dc646fe89d59a1ddfed729d1b7"title="A type to show a generic input dialog. ">MessageConfig::TypeInputDialog</a>. You can override it to customize how to show them.</p>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a4766ec05cd6999ee16505d472e48adf9"title="Called to present a dialog via a message config. ">WidgetsPresenter::showDialog</a></dd></dl>
<p>Called to present a dialog of <aclass="el"href="class_qt_mvvm_1_1_message_config.html#a4bf2b7c1738a86009303fbb07dcad08c"title="A type to show a standard message box. ">MessageConfig::TypeMessageBox</a>. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">config</td><td>The configuration of the message box </td></tr>
<tr><tdclass="paramname">result</td><td>The message result to report the result to </td></tr>
</table>
</dd>
</dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="class_qt_mvvm_1_1_presenter_exception.html"title="An exception to be thrown from the presenter if presenting fails. ">PresenterException</a></td><td>If presenting the dialog failed</td></tr>
</table>
</dd>
</dl>
<p>This method is called by <aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a4766ec05cd6999ee16505d472e48adf9"title="Called to present a dialog via a message config. ">showDialog()</a> to present a dialog from a message config with the <aclass="el"href="class_qt_mvvm_1_1_message_config.html#a8ddd0717a5f8a07f520df25743ded0da"title="The general type of dialog to be shown. ">MessageConfig::type</a> set to <aclass="el"href="class_qt_mvvm_1_1_message_config.html#a4bf2b7c1738a86009303fbb07dcad08c"title="A type to show a standard message box. ">MessageConfig::TypeMessageBox</a>. You can override it to customize how to show them.</p>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a4766ec05cd6999ee16505d472e48adf9"title="Called to present a dialog via a message config. ">WidgetsPresenter::showDialog</a></dd></dl>
<p>Called to present a dialog of a non standard <aclass="el"href="class_qt_mvvm_1_1_message_config.html#a8ddd0717a5f8a07f520df25743ded0da"title="The general type of dialog to be shown. ">MessageConfig::type</a>. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">config</td><td>The configuration of the dialog </td></tr>
<tr><tdclass="paramname">result</td><td>The message result to report the result to </td></tr>
</table>
</dd>
</dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="class_qt_mvvm_1_1_presenter_exception.html"title="An exception to be thrown from the presenter if presenting fails. ">PresenterException</a></td><td>If presenting the dialog failed</td></tr>
</table>
</dd>
</dl>
<p>This method is called by <aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a4766ec05cd6999ee16505d472e48adf9"title="Called to present a dialog via a message config. ">showDialog()</a> to present a dialog from a message config with the <aclass="el"href="class_qt_mvvm_1_1_message_config.html#a8ddd0717a5f8a07f520df25743ded0da"title="The general type of dialog to be shown. ">MessageConfig::type</a> set to to custom type (i.e. none of the 3 default types). The default implementation simply throws the <aclass="el"href="class_qt_mvvm_1_1_presenter_exception.html"title="An exception to be thrown from the presenter if presenting fails. ">PresenterException</a>. If you want to support additional types to the 3 default types, reimplement this method to do so.</p>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a4766ec05cd6999ee16505d472e48adf9"title="Called to present a dialog via a message config. ">WidgetsPresenter::showDialog</a></dd></dl>
<tr><tdclass="paramname">TView</td><td>The widget type register within the presenter. Must extend <aclass="elRef"target="_blank"doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtautoupdater/qtautoupdater.tags:https://doc.qt.io/qt-5/"href="https://doc.qt.io/qt-5/class_q_widget.html">QWidget</a></td></tr>
<p>The widget is registered with the current presenter. It is registered implicitly, which means that it's name will be used to find it when a viewmodel is presented for it. Thus, it must be named after the viewmodel. If the viewmodel is for example named <code>MyViewModel</code>, then the view must start with <code>My</code> too. For example it can be named <code>MyWidget</code>, <code>MyDialog</code>, <code>MyWindow</code>, <code>MyView</code>, ...</p>
<dlclass="section note"><dt>Note</dt><dd>Implicit detection of views for viewmodels can sometimes lead to ambiguities and thus a wrong view beeing found. In such cases, use <aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a3ff4fc6783162f3d9e8895d025e949c5"title="Register a view for a viewmodel to be found by the presenter. ">registerViewExplicitly()</a> instead.</dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a3ff4fc6783162f3d9e8895d025e949c5"title="Register a view for a viewmodel to be found by the presenter. ">WidgetsPresenter::registerViewExplicitly</a></dd></dl>
<pclass="definition">Definition at line <aclass="el"href="widgetspresenter_8h_source.html#l00102">102</a> of file <aclass="el"href="widgetspresenter_8h_source.html">widgetspresenter.h</a>.</p>
<tr><tdclass="paramname">viewType</td><td>The widget type register within the presenter. Must extend <aclass="elRef"target="_blank"doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtautoupdater/qtautoupdater.tags:https://doc.qt.io/qt-5/"href="https://doc.qt.io/qt-5/class_q_widget.html">QWidget</a></td></tr>
<p>The widget is registered with the current presenter. It is registered implicitly, which means that it's name will be used to find it when a viewmodel is presented for it. Thus, it must be named after the viewmodel. If the viewmodel is for example named <code>MyViewModel</code>, then the view must start with <code>My</code> too. For example it can be named <code>MyWidget</code>, <code>MyDialog</code>, <code>MyWindow</code>, <code>MyView</code>, ...</p>
<dlclass="section note"><dt>Note</dt><dd>Implicit detection of views for viewmodels can sometimes lead to ambiguities and thus a wrong view beeing found. In such cases, use <aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a3ff4fc6783162f3d9e8895d025e949c5"title="Register a view for a viewmodel to be found by the presenter. ">registerViewExplicitly()</a> instead.</dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a3ff4fc6783162f3d9e8895d025e949c5"title="Register a view for a viewmodel to be found by the presenter. ">WidgetsPresenter::registerViewExplicitly</a></dd></dl>
<tr><tdclass="paramname">TView</td><td>The widget type register within the presenter. Must extend <aclass="elRef"target="_blank"doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtautoupdater/qtautoupdater.tags:https://doc.qt.io/qt-5/"href="https://doc.qt.io/qt-5/class_q_widget.html">QWidget</a></td></tr>
<p>The widget is registered with the current presenter. It is registered explicitly, which means that whenever the given viewmodel is beeing presented, this exact view will be used. Explicit registration have precedence over implicit ones.</p>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a0b665bb6c87884d5789f616814c80cf6"title="Register a view to be found by the presenter. ">WidgetsPresenter::registerView</a></dd></dl>
<pclass="definition">Definition at line <aclass="el"href="widgetspresenter_8h_source.html#l00113">113</a> of file <aclass="el"href="widgetspresenter_8h_source.html">widgetspresenter.h</a>.</p>
<tr><tdclass="paramname">viewType</td><td>The widget type register within the presenter. Must extend <aclass="elRef"target="_blank"doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtautoupdater/qtautoupdater.tags:https://doc.qt.io/qt-5/"href="https://doc.qt.io/qt-5/class_q_widget.html">QWidget</a></td></tr>
<p>The widget is registered with the current presenter. It is registered explicitly, which means that whenever the given viewmodel is beeing presented, this exact view will be used. Explicit registration have precedence over implicit ones.</p>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a0b665bb6c87884d5789f616814c80cf6"title="Register a view to be found by the presenter. ">WidgetsPresenter::registerView</a></dd></dl>
<p>Called to present a dialog via a message config. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">config</td><td>The configuration for the dialog to be shown </td></tr>
<tr><tdclass="paramname">result</td><td>A reference to the object to report results to </td></tr>
</table>
</dd>
</dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="class_qt_mvvm_1_1_presenter_exception.html"title="An exception to be thrown from the presenter if presenting fails. ">PresenterException</a></td><td>When presenting fails for whatever reason</td></tr>
</table>
</dd>
</dl>
<p>This method should create a simple dialog based of the configuration passed to it. Read the <aclass="el"href="class_qt_mvvm_1_1_message_config.html"title="A configuration for a simple dialog to be shown from the core code. ">MessageConfig</a> for more details on the parameters. The <aclass="el"href="class_qt_mvvm_1_1_message_config.html#a8ddd0717a5f8a07f520df25743ded0da"title="The general type of dialog to be shown. ">MessageConfig::type</a> and <aclass="el"href="class_qt_mvvm_1_1_message_config.html#aa9f8a83b2ce22d09daf24aad158d7974"title="A subtype for the dialog to specify what exactly it should show. ">MessageConfig::subType</a> properties are used to determine the kind of dialog to be shown. The other properties are used to configure the dialog.</p>
<p>The result is a reference to a result object to report the result value and the pressed button to. The result is owned by the caller, you must never delete it. Use the special "GUI methods" to report the result and configure a close target.</p>
<p>If this method returns it is assumed the presentation was successful. If you throw the exception, presenting has failed, and the app will automatically complete the message result with the <aclass="el"href="class_qt_mvvm_1_1_message_config.html#ad6b7b271e558619f15c5eb9a3cf78fb8a83a48e3acfda22ae83280136ed2f6751"title="Equivalent to QMessageBox::NoButton. ">MessageConfig::NoButton</a> constant.</p>
<dlclass="section note"><dt>Note</dt><dd>If you need to present asynchronous, then you need to perform this step yourself in case the asynchronous presentation failed.</dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_i_presenter.html#a6bf902cf14d45c44fdcf78743d4e71a7"title="Called to present a viewmodel. ">IPresenter::present</a>, <aclass="el"href="class_qt_mvvm_1_1_message_config.html"title="A configuration for a simple dialog to be shown from the core code. ">MessageConfig</a>, <aclass="el"href="class_qt_mvvm_1_1_message_result.html"title="A result watcher to get the result once a dialog has finished. ">MessageResult</a>, <aclass="el"href="class_qt_mvvm_1_1_message_result.html#ac43f7ca1c7e3b10e6477c2a5d92348af"title="Completes the dialog and tells the result that it is finished. ">MessageResult::complete</a>, <aclass="el"href="class_qt_mvvm_1_1_message_result.html#adf611c77583607f2ea90764871ccd3cd"title="Sets an object and a method to be called to close the dialog. ">MessageResult::setCloseTarget</a></dd></dl>
<p>Called to show a widget in the foreground. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">view</td><td>The view to be presented</td></tr>
</table>
</dd>
</dl>
<p>This method is called by <aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a5e2f5776adff5584c1572e55b9fefd73"title="Try to present the given view on the parent view. ">tryPresent()</a> to simply show a standard window. The method however does not only show the window, but also makes shure it becomes the currently active foreground window.</p>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a5e2f5776adff5584c1572e55b9fefd73"title="Try to present the given view on the parent view. ">WidgetsPresenter::tryPresent</a></dd></dl>
<p>This method is called to perform the actual presentation (i.e. the parenting and how to show) the view. The default implementation first checks if the parent implements <aclass="el"href="class_qt_mvvm_1_1_i_presenting_view.html"title="A simple interface to make it possible for any view to present subviews. ">IPresentingView</a> and if yes if it is able to present the view. If not, a bunch of standard widget types are checked for special presentation methods. QDialogs are presented via <aclass="elRef"target="_blank"doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtwidgets/qtwidgets.tags:https://doc.qt.io/qt-5/"href="https://doc.qt.io/qt-5/qdialog.html#open">QDialog::open</a>. QDockWidgets that are presented to a <aclass="elRef"target="_blank"doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtwidgets/qtwidgets.tags:https://doc.qt.io/qt-5/"href="https://doc.qt.io/qt-5/qmainwindow.html">QMainWindow</a> are added as dock widget (<aclass="elRef"target="_blank"doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtwidgets/qtwidgets.tags:https://doc.qt.io/qt-5/"href="https://doc.qt.io/qt-5/qmainwindow.html#addDockWidget">QMainWindow::addDockWidget</a>). If the parent or its central widget are a <aclass="elRef"target="_blank"doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtwidgets/qtwidgets.tags:https://doc.qt.io/qt-5/"href="https://doc.qt.io/qt-5/qmdiarea.html">QMdiArea</a>, and the views class name ends with <code>MdiWindow</code>, it is presented as <aclass="elRef"target="_blank"doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtwidgets/qtwidgets.tags:https://doc.qt.io/qt-5/"href="https://doc.qt.io/qt-5/qmdisubwindow.html">QMdiSubWindow</a>. For all other cases, <aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a2a2d1c292c4117b542a7a610709b2a17"title="Called to show a widget in the foreground. ">showForeground()</a> is called.</p>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a2a2d1c292c4117b542a7a610709b2a17"title="Called to show a widget in the foreground. ">WidgetsPresenter::showForeground</a>, <aclass="elRef"target="_blank"doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtwidgets/qtwidgets.tags:https://doc.qt.io/qt-5/"href="https://doc.qt.io/qt-5/qdialog.html">QDialog</a>, <aclass="elRef"target="_blank"doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtwidgets/qtwidgets.tags:https://doc.qt.io/qt-5/"href="https://doc.qt.io/qt-5/qmainwindow.html">QMainWindow</a>, <aclass="elRef"target="_blank"doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtwidgets/qtwidgets.tags:https://doc.qt.io/qt-5/"href="https://doc.qt.io/qt-5/qdockwidget.html">QDockWidget</a>, <aclass="elRef"target="_blank"doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtwidgets/qtwidgets.tags:https://doc.qt.io/qt-5/"href="https://doc.qt.io/qt-5/qmdiarea.html">QMdiArea</a></dd></dl>
<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 factory different from the default one.</p>
<td><b>READ</b></td><td><aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a8d7ca39d6041fe36b5fd620ff3fc13f4"title="The factory to create input widgets with, as injected property. ">inputWidgetFactory()</a></td></tr>
<tr>
<td><b>WRITE</b></td><td><aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#a77e042c6ebe285bd6fc26a3a0d58534f"title="WRITE accessor for WidgetsPresenter::inputWidgetFactory. ">setInputWidgetFactory()</a></td></tr>
<tr>
<td><b>NOTIFY</b></td><td><aclass="el"href="class_qt_mvvm_1_1_widgets_presenter.html#af669b0161a6a7d26d723ff1bd7a0b552"title="NOTIFY accessor for WidgetsPresenter::inputWidgetFactory. ">inputWidgetFactoryChanged()</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="widgetspresenter_8h_source.html#l00025">25</a> of file <aclass="el"href="widgetspresenter_8h_source.html">widgetspresenter.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>