The primary namespace of the QtMvvm library. More...
Namespaces | |
SettingsElements | |
A sub namespace for the different elements in a settings setup. | |
Classes | |
class | AccountModel |
A list model implementation for QtDataSync::DeviceInfo via a QtDataSync::AccountManager. More... | |
class | Binding |
A handle to a multidirectional binding between properties. More... | |
class | CoreApp |
A logicaly application object to drive the mvvm application from the core part. More... | |
class | DataSyncViewModel |
A viewmodel to show a overview of the datasync status and account. More... | |
class | DataSyncWindow |
The widgets view implementation for the DataSyncViewModel. More... | |
class | ExchangeDevicesModel |
A list model implementation to show all devices available by the QtDataSync::UserExchangeManager. More... | |
class | InputViewFactory |
A factory class to generate input edit views by their type names. More... | |
class | InputWidgetFactory |
A factory class to generate input edit widgets by their type names. More... | |
class | IPresenter |
The interface for a GUI view presenter. More... | |
class | IPresentingView |
A simple interface to make it possible for any view to present subviews. More... | |
class | ISettingsSetupLoader |
An interface for a generic settings setup loader. More... | |
class | MessageConfig |
A configuration for a simple dialog to be shown from the core code. More... | |
class | MessageResult |
A result watcher to get the result once a dialog has finished. More... | |
class | NetworkExchangeViewModel |
A viewmodel to show a dialog to exchange account data via the QtDataSync::UserExchangeManager. More... | |
class | NetworkExchangeWindow |
The widgets view implementation for the NetworkExchangeViewModel. More... | |
class | PresenterException |
An exception to be thrown from the presenter if presenting fails. More... | |
class | QuickPresenter |
The IPresenter implementation for the quick module. More... | |
class | ServiceConstructionException |
Is thrown in case the construction of a service has failed. More... | |
class | ServiceDependencyException |
Is thrown if a service could not be created because of a missing dependency to be injected. More... | |
class | ServiceExistsException |
Is thrown if a service is beeing registered that is already registered. More... | |
class | ServiceRegistry |
A singleton to prepare services for dependency injection and to access them. More... | |
class | SettingsDialog |
The widgets view implementation for the SettingsViewModel. More... | |
class | SettingsLoaderException |
An exception throw in case loading a settings setup went wrong. More... | |
class | SettingsViewModel |
A ViewModel for a generic settings dialog based of an XML settings file. More... | |
class | ViewModel |
The base class for all viewmodels. More... | |
class | WidgetsPresenter |
The IPresenter implementation for the widgets module. More... | |
Functions | |
Q_MVVMCORE_EXPORT Binding | bind (QObject *viewModel, const char *viewModelProperty, QObject *view, const char *viewProperty, Binding::BindingDirection type=Binding::TwoWay, const char *viewModelChangeSignal=nullptr, const char *viewChangeSignal=nullptr) |
Create a multidirectional binding between properties. More... | |
Q_MVVMCORE_EXPORT Binding | bind (QObject *viewModel, const QMetaProperty &viewModelProperty, QObject *view, const QMetaProperty &viewProperty, Binding::BindingDirection type=Binding::TwoWay, const char *viewModelChangeSignal=nullptr, const char *viewChangeSignal=nullptr) |
Create a multidirectional binding between properties. More... | |
Q_MVVMCORE_EXPORT Binding | bind (QObject *viewModel, const QMetaProperty &viewModelProperty, QObject *view, const QMetaProperty &viewProperty, Binding::BindingDirection type=Binding::TwoWay, const QMetaMethod &viewModelChangeSignal={}, const QMetaMethod &viewChangeSignal={}) |
Create a multidirectional binding between properties. More... | |
template<typename TInterface > | |
void | registerInterfaceConverter () |
Registers QVariant converters from QObject to an interface type registered with Q_DECLARE_INTERFACE. | |
Q_MVVMDATASYNCQUICK_EXPORT void | registerDataSyncQuick () |
A method to initialize the datasync quick mvvm module. More... | |
Q_MVVMDATASYNCWIDGETS_EXPORT void | registerDataSyncWidgets () |
A method to initialize the datasync widgets mvvm module. More... | |
Methods to show simple messageboxes (MessageConfig::TypeMessageBox) | |
Q_MVVMCORE_EXPORT MessageResult * | information (const QString &title, const QString &text, const QString &okText={}) |
A shortcut to show a simple information messagebox. More... | |
Q_MVVMCORE_EXPORT void | information (const QString &title, const QString &text, QObject *scope, const std::function< void()> &onResult, const QString &okText={}) |
A shortcut to show a simple information messagebox. More... | |
Q_MVVMCORE_EXPORT void | information (const QString &title, const QString &text, const std::function< void()> &onResult, const QString &okText={}) |
A shortcut to show a simple information messagebox. More... | |
Q_MVVMCORE_EXPORT MessageResult * | question (const QString &title, const QString &text, const QString &yesText={}, const QString &noText={}) |
A shortcut to show a simple question messagebox. More... | |
Q_MVVMCORE_EXPORT void | question (const QString &title, const QString &text, QObject *scope, const std::function< void(bool)> &onResult, const QString &yesText={}, const QString &noText={}) |
A shortcut to show a simple question messagebox. More... | |
Q_MVVMCORE_EXPORT void | question (const QString &title, const QString &text, const std::function< void(bool)> &onResult, const QString &yesText={}, const QString &noText={}) |
A shortcut to show a simple question messagebox. More... | |
Q_MVVMCORE_EXPORT MessageResult * | warning (const QString &title, const QString &text, const QString &okText={}) |
A shortcut to show a simple warning messagebox. More... | |
Q_MVVMCORE_EXPORT void | warning (const QString &title, const QString &text, QObject *scope, const std::function< void()> &onResult, const QString &okText={}) |
A shortcut to show a simple warning messagebox. More... | |
Q_MVVMCORE_EXPORT void | warning (const QString &title, const QString &text, const std::function< void()> &onResult, const QString &okText={}) |
A shortcut to show a simple warning messagebox. More... | |
Q_MVVMCORE_EXPORT MessageResult * | critical (const QString &title, const QString &text, const QString &okText={}) |
A shortcut to show a simple critical error messagebox. More... | |
Q_MVVMCORE_EXPORT void | critical (const QString &title, const QString &text, QObject *scope, const std::function< void()> &onResult, const QString &okText={}) |
A shortcut to show a simple critical error messagebox. More... | |
Q_MVVMCORE_EXPORT void | critical (const QString &title, const QString &text, const std::function< void()> &onResult, const QString &okText={}) |
A shortcut to show a simple critical error messagebox. More... | |
Q_MVVMCORE_EXPORT MessageResult * | about (const QString &description, const QUrl &websiteUrl=QUrl(), const QString &licenseName=QString(), const QUrl &licenseUrl=QUrl(), const QString &companyName=QString(), bool addQtVersion=true, const QStringList &extraTopInfos=QStringList(), const QString &extraBottomInfos=QString()) |
A shortcut to show a rich but simple about dialog. More... | |
Methods to show simple input dialogs (MessageConfig::TypeInputDialog) | |
Q_MVVMCORE_EXPORT MessageResult * | getInput (const QString &title, const QString &text, const char *inputType, const QVariant &defaultValue={}, const QVariantMap &viewProperties={}, const QString &okText={}, const QString &cancelText={}) |
A shortcut to show an input dialog based of a type name. More... | |
Q_MVVMCORE_EXPORT void | getInput (const QString &title, const QString &text, const char *inputType, QObject *scope, const std::function< void(QVariant)> &onResult, const QVariant &defaultValue={}, const QVariantMap &viewProperties={}, const QString &okText={}, const QString &cancelText={}) |
A shortcut to show an input dialog based of a type name. More... | |
Q_MVVMCORE_EXPORT void | getInput (const QString &title, const QString &text, const char *inputType, const std::function< void(QVariant)> &onResult, const QVariant &defaultValue={}, const QVariantMap &viewProperties={}, const QString &okText={}, const QString &cancelText={}) |
A shortcut to show an input dialog based of a type name. More... | |
template<typename TEdit > | |
MessageResult * | getInput (const QString &title, const QString &text, const TEdit &defaultValue={}, const QVariantMap &viewProperties={}, const QString &okText={}, const QString &cancelText={}) |
A shortcut to show an input dialog based of a type as generic parameter. More... | |
template<typename TEdit > | |
void | getInput (const QString &title, const QString &text, QObject *scope, const std::function< void(TEdit, bool)> &onResult, const TEdit &defaultValue={}, const QVariantMap &viewProperties={}, const QString &okText={}, const QString &cancelText={}) |
A shortcut to show an input dialog based of a type as generic parameter. More... | |
template<typename TEdit > | |
void | getInput (const QString &title, const QString &text, const std::function< void(TEdit, bool)> &onResult, const TEdit &defaultValue={}, const QVariantMap &viewProperties={}, const QString &okText={}, const QString &cancelText={}) |
A shortcut to show an input dialog based of a type as generic parameter. More... | |
Methods to show simple file dialogs (MessageConfig::TypeFileDialog) | |
Q_MVVMCORE_EXPORT MessageResult * | getExistingDirectory (const QString &title={}, const QUrl &dir={}) |
A shortcut to show a file dialog to select an existing directory. More... | |
Q_MVVMCORE_EXPORT void | getExistingDirectory (QObject *scope, const std::function< void(QUrl)> &onResult, const QString &title={}, const QUrl &dir={}) |
A shortcut to show a file dialog to select an existing directory. More... | |
Q_MVVMCORE_EXPORT void | getExistingDirectory (const std::function< void(QUrl)> &onResult, const QString &title={}, const QUrl &dir={}) |
A shortcut to show a file dialog to select an existing directory. More... | |
Q_MVVMCORE_EXPORT MessageResult * | getOpenFile (const QString &title={}, const QStringList &supportedMimeTypes={}, const QUrl &dir={}) |
A shortcut to show a file dialog to select an existing file. More... | |
Q_MVVMCORE_EXPORT void | getOpenFile (QObject *scope, const std::function< void(QUrl)> &onResult, const QString &title={}, const QStringList &supportedMimeTypes={}, const QUrl &dir={}) |
A shortcut to show a file dialog to select an existing file. More... | |
Q_MVVMCORE_EXPORT void | getOpenFile (const std::function< void(QUrl)> &onResult, const QString &title={}, const QStringList &supportedMimeTypes={}, const QUrl &dir={}) |
A shortcut to show a file dialog to select an existing file. More... | |
Q_MVVMCORE_EXPORT MessageResult * | getOpenFiles (const QString &title={}, const QStringList &supportedMimeTypes={}, const QUrl &dir={}) |
A shortcut to show a file dialog to select multiple existing files. More... | |
Q_MVVMCORE_EXPORT void | getOpenFiles (QObject *scope, const std::function< void(QList< QUrl >)> &onResult, const QString &title={}, const QStringList &supportedMimeTypes={}, const QUrl &dir={}) |
A shortcut to show a file dialog to select multiple existing files. More... | |
Q_MVVMCORE_EXPORT void | getOpenFiles (const std::function< void(QList< QUrl >)> &onResult, const QString &title={}, const QStringList &supportedMimeTypes={}, const QUrl &dir={}) |
A shortcut to show a file dialog to select multiple existing files. More... | |
Q_MVVMCORE_EXPORT MessageResult * | getSaveFile (const QString &title={}, const QStringList &supportedMimeTypes={}, const QUrl &dir={}) |
A shortcut to show a file dialog to select a new file for saving. More... | |
Q_MVVMCORE_EXPORT void | getSaveFile (QObject *scope, const std::function< void(QUrl)> &onResult, const QString &title={}, const QStringList &supportedMimeTypes={}, const QUrl &dir={}) |
A shortcut to show a file dialog to select a new file for saving. More... | |
Q_MVVMCORE_EXPORT void | getSaveFile (const std::function< void(QUrl)> &onResult, const QString &title={}, const QStringList &supportedMimeTypes={}, const QUrl &dir={}) |
A shortcut to show a file dialog to select a new file for saving. More... | |
The primary namespace of the QtMvvm library.
The following list shows which classes belong to which Qt module, in alphabetical order:
QtMvvm::about | ( | const QString & | description, |
const QUrl & | websiteUrl = QUrl() , |
||
const QString & | licenseName = QString() , |
||
const QUrl & | licenseUrl = QUrl() , |
||
const QString & | companyName = QString() , |
||
bool | addQtVersion = true , |
||
const QStringList & | extraTopInfos = QStringList() , |
||
const QString & | extraBottomInfos = QString() |
||
) |
A shortcut to show a rich but simple about dialog.
description | A short descriptive text what your application is all about |
websiteUrl | The URL to your website |
licenseName | The name of the License you are using |
licenseUrl | A URL to an online (or offline) variant of the license to read for the user |
companyName | The name of your company or your name as creator of the application |
addQtVersion | Specify whether the Qt Version should be visible as part of the about dialog |
extraTopInfos | Additional short texts to be shown below the version |
extraBottomInfos | An additional text to be shown at the bottom of the dialog |
Creates an advanced about dialog out of all of this information in an organized manner. The extraTopInfos
are ment as short extra information about configurations etc, for example a specific plattform plugin used, as selected style or further important links. The extraBottomInfos
can be a long and rich text with anything else you want to put in the about dialog that is not applicabale for the previous part (for example a list of contributers).
<p></p>
blocks. Furthermore, QML only supports a small subset of HTML in the default text mode that is used.QtMvvm::bind | ( | QObject * | viewModel, |
const char * | viewModelProperty, | ||
QObject * | view, | ||
const char * | viewProperty, | ||
Binding::BindingDirection | type = Binding::TwoWay , |
||
const char * | viewModelChangeSignal = nullptr , |
||
const char * | viewChangeSignal = nullptr |
||
) |
Create a multidirectional binding between properties.
viewModel | The object in the role of a viewmodel |
viewModelProperty | The property of the viewmodel to use in the binding |
view | The object in the role of a view |
viewProperty | The property of the view to use in the binding |
type | The type/direction of binding to create |
viewModelChangeSignal | An alternative signal to be used instead of the viewModelProperty notify signal to detect property changes |
viewChangeSignal | An alternative signal to be used instead of the viewProperty notify signal to detect property changes |
The methods creates a binding similar to the QML bindings, but it is possible to create two-way bindings with this method as well. A binding means that whenever a property changes, the property it is bound to is updated to the changed value as well.
To control the directions, i.e. which properties should trigger an update on changes and which only get updated, use the type
parameter.
If the properties you want to use don't have a change signal or you don't want to use that signal, you can use the viewModelChangeSignal
and viewChangeSignal
to overwrite the signal to be used. Please note that you must specify the full signal signature. For example, the signatur of the signal void foo(const QString &bar);
has the signature foo(QString)
. See QMetaMethod for more details. If you leave the parameter out or set it to nullptr
(or {}
, an invalid meta method) the notify signals of the properties are used.
Q_MVVMCORE_EXPORT Binding QtMvvm::bind | ( | QObject * | viewModel, |
const QMetaProperty & | viewModelProperty, | ||
QObject * | view, | ||
const QMetaProperty & | viewProperty, | ||
Binding::BindingDirection | type = Binding::TwoWay , |
||
const char * | viewModelChangeSignal = nullptr , |
||
const char * | viewChangeSignal = nullptr |
||
) |
Create a multidirectional binding between properties.
viewModel | The object in the role of a viewmodel |
viewModelProperty | The property of the viewmodel to use in the binding |
view | The object in the role of a view |
viewProperty | The property of the view to use in the binding |
type | The type/direction of binding to create |
viewModelChangeSignal | An alternative signal to be used instead of the viewModelProperty notify signal to detect property changes |
viewChangeSignal | An alternative signal to be used instead of the viewProperty notify signal to detect property changes |
The methods creates a binding similar to the QML bindings, but it is possible to create two-way bindings with this method as well. A binding means that whenever a property changes, the property it is bound to is updated to the changed value as well.
To control the directions, i.e. which properties should trigger an update on changes and which only get updated, use the type
parameter.
If the properties you want to use don't have a change signal or you don't want to use that signal, you can use the viewModelChangeSignal
and viewChangeSignal
to overwrite the signal to be used. Please note that you must specify the full signal signature. For example, the signatur of the signal void foo(const QString &bar);
has the signature foo(QString)
. See QMetaMethod for more details. If you leave the parameter out or set it to nullptr
(or {}
, an invalid meta method) the notify signals of the properties are used.
Q_MVVMCORE_EXPORT Binding QtMvvm::bind | ( | QObject * | viewModel, |
const QMetaProperty & | viewModelProperty, | ||
QObject * | view, | ||
const QMetaProperty & | viewProperty, | ||
Binding::BindingDirection | type = Binding::TwoWay , |
||
const QMetaMethod & | viewModelChangeSignal = {} , |
||
const QMetaMethod & | viewChangeSignal = {} |
||
) |
Create a multidirectional binding between properties.
viewModel | The object in the role of a viewmodel |
viewModelProperty | The property of the viewmodel to use in the binding |
view | The object in the role of a view |
viewProperty | The property of the view to use in the binding |
type | The type/direction of binding to create |
viewModelChangeSignal | An alternative signal to be used instead of the viewModelProperty notify signal to detect property changes |
viewChangeSignal | An alternative signal to be used instead of the viewProperty notify signal to detect property changes |
The methods creates a binding similar to the QML bindings, but it is possible to create two-way bindings with this method as well. A binding means that whenever a property changes, the property it is bound to is updated to the changed value as well.
To control the directions, i.e. which properties should trigger an update on changes and which only get updated, use the type
parameter.
If the properties you want to use don't have a change signal or you don't want to use that signal, you can use the viewModelChangeSignal
and viewChangeSignal
to overwrite the signal to be used. Please note that you must specify the full signal signature. For example, the signatur of the signal void foo(const QString &bar);
has the signature foo(QString)
. See QMetaMethod for more details. If you leave the parameter out or set it to nullptr
(or {}
, an invalid meta method) the notify signals of the properties are used.
A shortcut to show a simple critical error messagebox.
title | The messagebox title (MessageConfig::title) |
text | The primary message text (MessageConfig::text) |
okText | An optional text overwrite for the OK button (MessageConfig::buttonTexts) |
Shows a simple critical error dialog with a title, a text and the OK button present.
QtMvvm::critical | ( | const QString & | title, |
const QString & | text, | ||
QObject * | scope, | ||
const std::function< void()> & | onResult, | ||
const QString & | okText = {} |
||
) |
A shortcut to show a simple critical error messagebox.
scope | A scope to limit to. onResult is only called as long as scope has not been deleted |
onResult | A handler to be called when the message box has been closed |
title | The messagebox title (MessageConfig::title) |
text | The primary message text (MessageConfig::text) |
okText | An optional text overwrite for the OK button (MessageConfig::buttonTexts) |
Shows a simple critical error dialog with a title, a text and the OK button present.
QtMvvm::critical | ( | const QString & | title, |
const QString & | text, | ||
const std::function< void()> & | onResult, | ||
const QString & | okText = {} |
||
) |
A shortcut to show a simple critical error messagebox.
onResult | A handler to be called when the message box has been closed |
title | The messagebox title (MessageConfig::title) |
text | The primary message text (MessageConfig::text) |
okText | An optional text overwrite for the OK button (MessageConfig::buttonTexts) |
Shows a simple critical error dialog with a title, a text and the OK button present.
A shortcut to show a file dialog to select an existing directory.
title | The input dialog title (MessageConfig::title) |
dir | The directory URL to start the file dialog from (MessageConfig::defaultValue) |
Shows a folder dialog to let the user select an existing directory.
QtMvvm::getExistingDirectory | ( | QObject * | scope, |
const std::function< void(QUrl)> & | onResult, | ||
const QString & | title = {} , |
||
const QUrl & | dir = {} |
||
) |
A shortcut to show a file dialog to select an existing directory.
scope | A scope to limit to. onResult is only called as long as scope has not been deleted |
onResult | A handler to be called when the folder dialog has been closed. Reports the selected directory URL or an invalid URL in case the input has been canceled. |
title | The input dialog title (MessageConfig::title) |
dir | The directory URL to start the file dialog from (MessageConfig::defaultValue) |
Shows a folder dialog to let the user select an existing directory.
QtMvvm::getExistingDirectory | ( | const std::function< void(QUrl)> & | onResult, |
const QString & | title = {} , |
||
const QUrl & | dir = {} |
||
) |
A shortcut to show a file dialog to select an existing directory.
onResult | A handler to be called when the folder dialog has been closed. Reports the selected directory URL or an invalid URL in case the input has been canceled. |
title | The input dialog title (MessageConfig::title) |
dir | The directory URL to start the file dialog from (MessageConfig::defaultValue) |
Shows a folder dialog to let the user select an existing directory.
QtMvvm::getInput | ( | const QString & | title, |
const QString & | text, | ||
const char * | inputType, | ||
const QVariant & | defaultValue = {} , |
||
const QVariantMap & | viewProperties = {} , |
||
const QString & | okText = {} , |
||
const QString & | cancelText = {} |
||
) |
A shortcut to show an input dialog based of a type name.
title | The input dialog title (MessageConfig::title) |
text | A label to describe what to input (MessageConfig::text) |
inputType | The data type of the edit to be used (MessageConfig::subType) |
defaultValue | A default value to initialize the edit with (MessageConfig::defaultValue) |
viewProperties | Additional properties to be passed to the edit (MessageConfig::viewProperties) |
okText | An optional text overwrite for the OK button (MessageConfig::buttonTexts) |
cancelText | An optional text overwrite for the CANCEL button (MessageConfig::buttonTexts) |
Shows an input dialog. The kind of edit to use is determined by using the inputType
. The view properties will be applied to both, the dialog and the edit.
QtMvvm::getInput | ( | const QString & | title, |
const QString & | text, | ||
const char * | inputType, | ||
QObject * | scope, | ||
const std::function< void(QVariant)> & | onResult, | ||
const QVariant & | defaultValue = {} , |
||
const QVariantMap & | viewProperties = {} , |
||
const QString & | okText = {} , |
||
const QString & | cancelText = {} |
||
) |
A shortcut to show an input dialog based of a type name.
scope | A scope to limit to. onResult is only called as long as scope has not been deleted |
onResult | A handler to be called when the input dialog has been closed. Reports the result or an invalid variant in case the input has been canceled. |
title | The input dialog title (MessageConfig::title) |
text | A label to describe what to input (MessageConfig::text) |
inputType | The data type of the edit to be used (MessageConfig::subType) |
defaultValue | A default value to initialize the edit with (MessageConfig::defaultValue) |
viewProperties | Additional properties to be passed to the edit (MessageConfig::viewProperties) |
okText | An optional text overwrite for the OK button (MessageConfig::buttonTexts) |
cancelText | An optional text overwrite for the CANCEL button (MessageConfig::buttonTexts) |
Shows an input dialog. The kind of edit to use is determined by using the inputType
. The view properties will be applied to both, the dialog and the edit.
QtMvvm::getInput | ( | const QString & | title, |
const QString & | text, | ||
const char * | inputType, | ||
const std::function< void(QVariant)> & | onResult, | ||
const QVariant & | defaultValue = {} , |
||
const QVariantMap & | viewProperties = {} , |
||
const QString & | okText = {} , |
||
const QString & | cancelText = {} |
||
) |
A shortcut to show an input dialog based of a type name.
onResult | A handler to be called when the input dialog has been closed. Reports the result or an invalid variant in case the input has been canceled. |
title | The input dialog title (MessageConfig::title) |
text | A label to describe what to input (MessageConfig::text) |
inputType | The data type of the edit to be used (MessageConfig::subType) |
defaultValue | A default value to initialize the edit with (MessageConfig::defaultValue) |
viewProperties | Additional properties to be passed to the edit (MessageConfig::viewProperties) |
okText | An optional text overwrite for the OK button (MessageConfig::buttonTexts) |
cancelText | An optional text overwrite for the CANCEL button (MessageConfig::buttonTexts) |
Shows an input dialog. The kind of edit to use is determined by using the inputType
. The view properties will be applied to both, the dialog and the edit.
|
inline |
A shortcut to show an input dialog based of a type as generic parameter.
title | The input dialog title (MessageConfig::title) |
text | A label to describe what to input (MessageConfig::text) |
defaultValue | A default value to initialize the edit with (MessageConfig::defaultValue) |
viewProperties | Additional properties to be passed to the edit (MessageConfig::viewProperties) |
okText | An optional text overwrite for the OK button (MessageConfig::buttonTexts) |
cancelText | An optional text overwrite for the CANCEL button (MessageConfig::buttonTexts) |
TEdit | The input to type to create an edit for and to get a value of |
Shows an input dialog. The kind of edit to use is determined by using the TEdit
type name. The view properties will be applied to both, the dialog and the edit.
|
inline |
A shortcut to show an input dialog based of a type as generic parameter.
scope | A scope to limit to. onResult is only called as long as scope has not been deleted |
onResult | A handler to be called when the input dialog has been closed. Reports the result and true as second parameter, or a default constructed value and false in case the input has been canceled |
title | The input dialog title (MessageConfig::title) |
text | A label to describe what to input (MessageConfig::text) |
defaultValue | A default value to initialize the edit with (MessageConfig::defaultValue) |
viewProperties | Additional properties to be passed to the edit (MessageConfig::viewProperties) |
okText | An optional text overwrite for the OK button (MessageConfig::buttonTexts) |
cancelText | An optional text overwrite for the CANCEL button (MessageConfig::buttonTexts) |
TEdit | The input to type to create an edit for and to get a value of |
Shows an input dialog. The kind of edit to use is determined by using the TEdit
type name. The view properties will be applied to both, the dialog and the edit.
|
inline |
A shortcut to show an input dialog based of a type as generic parameter.
onResult | A handler to be called when the input dialog has been closed. Reports the result and true as second parameter, or a default constructed value and false in case the input has been canceled |
title | The input dialog title (MessageConfig::title) |
text | A label to describe what to input (MessageConfig::text) |
defaultValue | A default value to initialize the edit with (MessageConfig::defaultValue) |
viewProperties | Additional properties to be passed to the edit (MessageConfig::viewProperties) |
okText | An optional text overwrite for the OK button (MessageConfig::buttonTexts) |
cancelText | An optional text overwrite for the CANCEL button (MessageConfig::buttonTexts) |
TEdit | The input to type to create an edit for and to get a value of |
Shows an input dialog. The kind of edit to use is determined by using the TEdit
type name. The view properties will be applied to both, the dialog and the edit.
QtMvvm::getOpenFile | ( | const QString & | title = {} , |
const QStringList & | supportedMimeTypes = {} , |
||
const QUrl & | dir = {} |
||
) |
A shortcut to show a file dialog to select an existing file.
title | The input dialog title (MessageConfig::title) |
supportedMimeTypes | A list of all allowed mimetypes (MessageConfig::viewProperties, extra property named mimeTypes ) |
dir | The directory URL to start the file dialog from (MessageConfig::defaultValue) |
Shows a file dialog to let the user select an existing file. The selectable files are limited to the mime types allowed.
QtMvvm::getOpenFile | ( | QObject * | scope, |
const std::function< void(QUrl)> & | onResult, | ||
const QString & | title = {} , |
||
const QStringList & | supportedMimeTypes = {} , |
||
const QUrl & | dir = {} |
||
) |
A shortcut to show a file dialog to select an existing file.
scope | A scope to limit to. onResult is only called as long as scope has not been deleted |
onResult | A handler to be called when the file dialog has been closed. Reports the selected file URL or an invalid URL in case the input has been canceled. |
title | The input dialog title (MessageConfig::title) |
supportedMimeTypes | A list of all allowed mimetypes (MessageConfig::viewProperties, extra property named mimeTypes ) |
dir | The directory URL to start the file dialog from (MessageConfig::defaultValue) |
Shows a file dialog to let the user select an existing file. The selectable files are limited to the mime types allowed.
QtMvvm::getOpenFile | ( | const std::function< void(QUrl)> & | onResult, |
const QString & | title = {} , |
||
const QStringList & | supportedMimeTypes = {} , |
||
const QUrl & | dir = {} |
||
) |
A shortcut to show a file dialog to select an existing file.
onResult | A handler to be called when the file dialog has been closed. Reports the selected file URL or an invalid URL in case the input has been canceled. |
title | The input dialog title (MessageConfig::title) |
supportedMimeTypes | A list of all allowed mimetypes (MessageConfig::viewProperties, extra property named mimeTypes ) |
dir | The directory URL to start the file dialog from (MessageConfig::defaultValue) |
Shows a file dialog to let the user select an existing file. The selectable files are limited to the mime types allowed.
QtMvvm::getOpenFiles | ( | const QString & | title = {} , |
const QStringList & | supportedMimeTypes = {} , |
||
const QUrl & | dir = {} |
||
) |
A shortcut to show a file dialog to select multiple existing files.
title | The input dialog title (MessageConfig::title) |
supportedMimeTypes | A list of all allowed mimetypes (MessageConfig::viewProperties, extra property named mimeTypes ) |
dir | The directory URL to start the file dialog from (MessageConfig::defaultValue) |
Shows a file dialog to let the user select multiple existing files. The selectable files are limited to the mime types allowed.
QtMvvm::getOpenFiles | ( | QObject * | scope, |
const std::function< void(QList< QUrl >)> & | onResult, | ||
const QString & | title = {} , |
||
const QStringList & | supportedMimeTypes = {} , |
||
const QUrl & | dir = {} |
||
) |
A shortcut to show a file dialog to select multiple existing files.
scope | A scope to limit to. onResult is only called as long as scope has not been deleted |
onResult | A handler to be called when the file dialog has been closed. Reports the selected file URLs in a list or an empty list in case the input has been canceled. |
title | The input dialog title (MessageConfig::title) |
supportedMimeTypes | A list of all allowed mimetypes (MessageConfig::viewProperties, extra property named mimeTypes ) |
dir | The directory URL to start the file dialog from (MessageConfig::defaultValue) |
Shows a file dialog to let the user select multiple existing files. The selectable files are limited to the mime types allowed.
QtMvvm::getOpenFiles | ( | const std::function< void(QList< QUrl >)> & | onResult, |
const QString & | title = {} , |
||
const QStringList & | supportedMimeTypes = {} , |
||
const QUrl & | dir = {} |
||
) |
A shortcut to show a file dialog to select multiple existing files.
onResult | A handler to be called when the file dialog has been closed. Reports the selected file URLs in a list or an empty list in case the input has been canceled. |
title | The input dialog title (MessageConfig::title) |
supportedMimeTypes | A list of all allowed mimetypes (MessageConfig::viewProperties, extra property named mimeTypes ) |
dir | The directory URL to start the file dialog from (MessageConfig::defaultValue) |
Shows a file dialog to let the user select multiple existing files. The selectable files are limited to the mime types allowed.
QtMvvm::getSaveFile | ( | const QString & | title = {} , |
const QStringList & | supportedMimeTypes = {} , |
||
const QUrl & | dir = {} |
||
) |
A shortcut to show a file dialog to select a new file for saving.
title | The input dialog title (MessageConfig::title) |
supportedMimeTypes | A list of all allowed mimetypes (MessageConfig::viewProperties, extra property named mimeTypes ) |
dir | The directory URL to start the file dialog from (MessageConfig::defaultValue) |
Shows a file dialog to let the user select an (non existing) file name for saving. The selectable files are limited to the mime types allowed.
QtMvvm::getSaveFile | ( | QObject * | scope, |
const std::function< void(QUrl)> & | onResult, | ||
const QString & | title = {} , |
||
const QStringList & | supportedMimeTypes = {} , |
||
const QUrl & | dir = {} |
||
) |
A shortcut to show a file dialog to select a new file for saving.
scope | A scope to limit to. onResult is only called as long as scope has not been deleted |
onResult | A handler to be called when the file dialog has been closed. Reports the selected file URL or an invalid URL in case the input has been canceled. |
title | The input dialog title (MessageConfig::title) |
supportedMimeTypes | A list of all allowed mimetypes (MessageConfig::viewProperties, extra property named mimeTypes ) |
dir | The directory URL to start the file dialog from (MessageConfig::defaultValue) |
Shows a file dialog to let the user select an (non existing) file name for saving. The selectable files are limited to the mime types allowed.
QtMvvm::getSaveFile | ( | const std::function< void(QUrl)> & | onResult, |
const QString & | title = {} , |
||
const QStringList & | supportedMimeTypes = {} , |
||
const QUrl & | dir = {} |
||
) |
A shortcut to show a file dialog to select a new file for saving.
onResult | A handler to be called when the file dialog has been closed. Reports the selected file URL or an invalid URL in case the input has been canceled. |
title | The input dialog title (MessageConfig::title) |
supportedMimeTypes | A list of all allowed mimetypes (MessageConfig::viewProperties, extra property named mimeTypes ) |
dir | The directory URL to start the file dialog from (MessageConfig::defaultValue) |
Shows a file dialog to let the user select an (non existing) file name for saving. The selectable files are limited to the mime types allowed.
A shortcut to show a simple information messagebox.
title | The messagebox title (MessageConfig::title) |
text | The primary message text (MessageConfig::text) |
okText | An optional text overwrite for the OK button (MessageConfig::buttonTexts) |
Shows a simple informative dialog with a title, a text and the OK button present.
QtMvvm::information | ( | const QString & | title, |
const QString & | text, | ||
QObject * | scope, | ||
const std::function< void()> & | onResult, | ||
const QString & | okText = {} |
||
) |
A shortcut to show a simple information messagebox.
scope | A scope to limit to. onResult is only called as long as scope has not been deleted |
onResult | A handler to be called when the message box has been closed |
title | The messagebox title (MessageConfig::title) |
text | The primary message text (MessageConfig::text) |
okText | An optional text overwrite for the OK button (MessageConfig::buttonTexts) |
Shows a simple informative dialog with a title, a text and the OK button present.
QtMvvm::information | ( | const QString & | title, |
const QString & | text, | ||
const std::function< void()> & | onResult, | ||
const QString & | okText = {} |
||
) |
A shortcut to show a simple information messagebox.
onResult | A handler to be called when the message box has been closed |
title | The messagebox title (MessageConfig::title) |
text | The primary message text (MessageConfig::text) |
okText | An optional text overwrite for the OK button (MessageConfig::buttonTexts) |
Shows a simple informative dialog with a title, a text and the OK button present.
QtMvvm::question | ( | const QString & | title, |
const QString & | text, | ||
const QString & | yesText = {} , |
||
const QString & | noText = {} |
||
) |
A shortcut to show a simple question messagebox.
title | The messagebox title (MessageConfig::title) |
text | The primary message text (MessageConfig::text) |
yesText | An optional text overwrite for the YES button (MessageConfig::buttonTexts) |
noText | An optional text overwrite for the NO button (MessageConfig::buttonTexts) |
Shows a simple question dialog with a title, a text and two buttons (typically YES and NO) to ask the user a simple boolean question.
QtMvvm::question | ( | const QString & | title, |
const QString & | text, | ||
QObject * | scope, | ||
const std::function< void(bool)> & | onResult, | ||
const QString & | yesText = {} , |
||
const QString & | noText = {} |
||
) |
A shortcut to show a simple question messagebox.
scope | A scope to limit to. onResult is only called as long as scope has not been deleted |
onResult | A handler to be called when the message box has been closed. The parameter is true if the user pressed YES, false if he pressed NO or cancled the dialog |
title | The messagebox title (MessageConfig::title) |
text | The primary message text (MessageConfig::text) |
yesText | An optional text overwrite for the YES button (MessageConfig::buttonTexts) |
noText | An optional text overwrite for the NO button (MessageConfig::buttonTexts) |
Shows a simple question dialog with a title, a text and two buttons (typically YES and NO) to ask the user a simple boolean question.
QtMvvm::question | ( | const QString & | title, |
const QString & | text, | ||
const std::function< void(bool)> & | onResult, | ||
const QString & | yesText = {} , |
||
const QString & | noText = {} |
||
) |
A shortcut to show a simple question messagebox.
onResult | A handler to be called when the message box has been closed. The parameter is true if the user pressed YES, false if he pressed NO or cancled the dialog |
title | The messagebox title (MessageConfig::title) |
text | The primary message text (MessageConfig::text) |
yesText | An optional text overwrite for the YES button (MessageConfig::buttonTexts) |
noText | An optional text overwrite for the NO button (MessageConfig::buttonTexts) |
Shows a simple question dialog with a title, a text and two buttons (typically YES and NO) to ask the user a simple boolean question.
QtMvvm::registerDataSyncQuick | ( | ) |
A method to initialize the datasync quick mvvm module.
You must add this method to your main.cpp in order to register all the datasync views with the QuickPresenter when using the quick ui:
QtMvvm::registerDataSyncWidgets | ( | ) |
A method to initialize the datasync widgets mvvm module.
You must add this method to your main.cpp in order to register all the datasync views with the WidgetsPresenter when using the widgets ui:
A shortcut to show a simple warning messagebox.
title | The messagebox title (MessageConfig::title) |
text | The primary message text (MessageConfig::text) |
okText | An optional text overwrite for the OK button (MessageConfig::buttonTexts) |
Shows a simple warning dialog with a title, a text and the OK button present.
QtMvvm::warning | ( | const QString & | title, |
const QString & | text, | ||
QObject * | scope, | ||
const std::function< void()> & | onResult, | ||
const QString & | okText = {} |
||
) |
A shortcut to show a simple warning messagebox.
scope | A scope to limit to. onResult is only called as long as scope has not been deleted |
onResult | A handler to be called when the message box has been closed |
title | The messagebox title (MessageConfig::title) |
text | The primary message text (MessageConfig::text) |
okText | An optional text overwrite for the OK button (MessageConfig::buttonTexts) |
Shows a simple warning dialog with a title, a text and the OK button present.
QtMvvm::warning | ( | const QString & | title, |
const QString & | text, | ||
const std::function< void()> & | onResult, | ||
const QString & | okText = {} |
||
) |
A shortcut to show a simple warning messagebox.
onResult | A handler to be called when the message box has been closed |
title | The messagebox title (MessageConfig::title) |
text | The primary message text (MessageConfig::text) |
okText | An optional text overwrite for the OK button (MessageConfig::buttonTexts) |
Shows a simple warning dialog with a title, a text and the OK button present.