@@ -380,6 +380,8 @@ to save content to it.
380380@sa MessageConfig::type, MessageConfig::subType, MessageConfig::TypeFileDialog
381381*/
382382
383+
384+
383385/*!
384386@class QtMvvm::MessageResult
385387
@@ -423,3 +425,212 @@ dialogDone(), as long as they are direct connected.
423425
424426@sa MessageResult::complete, MessageResult::dialogDone
425427*/
428+
429+ /*!
430+ @fn QtMvvm::MessageResult::setCloseTarget(QObject *, const QString &)
431+
432+ @param closeObject The object to call the method on
433+ @param closeMethod The method to be called
434+
435+ @attention This method should be used by the presenter only, not from the core
436+
437+ Use it from the presenter to register a view and a method on the view to be called to close
438+ the view. The `closeMethod` should be a paremeterless method signature (e.g. `close()`). Not
439+ settings a close target means that the dialog cannot be closed from code via discardMessage().
440+
441+ @sa MessageResult::discardMessage
442+ */
443+
444+ /*!
445+ @fn QtMvvm::MessageResult::complete(QtMvvm::MessageConfig::StandardButton)
446+
447+ @param button The button that was pressed by the user
448+
449+ @attention This method should be used by the presenter only, not from the core
450+
451+ You must use this method from the GUI view code to mark a message result as completed as soon
452+ as the user completed the dialog. The `button` should be the button the user pressed, or
453+ MessageConfig::NoButton if close by another reason. The pressed button should be one that was
454+ in the list of buttons specified by the MessageConfig that created the dialog (with the
455+ NoButton beeing the only exception).
456+
457+ The method automatically emits the dialogDone() signal and handels self deletion in a
458+ threadsafe manner.
459+
460+ @sa MessageResult::dialogDone, MessageResult::result, MessageResult::autoDelete
461+ */
462+
463+ /*!
464+ @fn QtMvvm::MessageResult::complete(QtMvvm::MessageConfig::StandardButton, const QVariant &)
465+
466+ @param result The input result to be set as MessageResult::result
467+ @copydetails MessageResult::complete(QtMvvm::MessageConfig::StandardButton)
468+ */
469+
470+ /*!
471+ @fn QtMvvm::MessageResult::discardMessage
472+
473+ Calls the closeMethod set by the presenter (if one was set) to close the dialog. Connect to
474+ the dialogDone() signal to be notified when the dialog was closed. It is typically emitted with
475+ MessageConfig::NoButton when beeing discarded this way.
476+
477+ @sa MessageResult::setCloseTarget, MessageResult::dialogDone
478+ */
479+
480+ /*!
481+ @fn QtMvvm::MessageResult::dialogDone
482+
483+ @param button The button that was pressed by the user to complete the dialog
484+
485+ Is emitted as soon as the dialog was closed with the button that was pressed, or
486+ MessageConfig::NoButton when closed another way. If the dialog had an input edit for the user
487+ to enter a value, you can retrieve the result via MessageResult::result.
488+
489+ @warning You must always direct connect to this signal, because if the auto deletion is
490+ enabled, the result will be deleted right after the signal was emitted (and thus after all
491+ direct connected slots have been called). You may use MessageResult::result only in a slot
492+ connect to this signal, because auf the reason above, and because before the signal it is
493+ considered invalid.
494+
495+ @sa MessageResult::result, MessageResult::complete
496+ */
497+
498+
499+
500+ /*!
501+ @fn QtMvvm::information(const QString &, const QString &, const QString &)
502+
503+ @param title The messagebox title (MessageConfig::title)
504+ @param text The primary message text (MessageConfig::text)
505+ @param okText An optional text overwrite for the OK button (MessageConfig::buttonTexts)
506+
507+ Shows a simple informative dialog with a title, a text and the OK button present.
508+
509+ @sa QtMvvm::question, QtMvvm::warning, QtMvvm::critical, QtMvvm::about, MessageConfig,
510+ CoreApp::showDialog
511+ */
512+
513+ /*!
514+ @fn QtMvvm::information(const QString &, const QString &, const std::function<void()> &, const QString &)
515+
516+ @param onResult A handler to be called when the message box has been closed
517+ @copydetails QtMvvm::information(const QString &, const QString &, const QString &)
518+ */
519+
520+ /*!
521+ @fn QtMvvm::information(const QString &, const QString &, QObject *, const std::function<void()> &, const QString &)
522+
523+ @param scope A scope to limit to. `onResult` is only called as long as scope has not been deleted
524+ @copydetails QtMvvm::information(const QString &, const QString &, const std::function<void()> &, const QString &)
525+ */
526+
527+ /*!
528+ @fn QtMvvm::question(const QString &, const QString &, const QString &, const QString &)
529+
530+ @param title The messagebox title (MessageConfig::title)
531+ @param text The primary message text (MessageConfig::text)
532+ @param yesText An optional text overwrite for the YES button (MessageConfig::buttonTexts)
533+ @param noText An optional text overwrite for the NO button (MessageConfig::buttonTexts)
534+
535+ Shows a simple question dialog with a title, a text and two buttons (typically YES and NO) to
536+ ask the user a simple boolean question.
537+
538+ @sa QtMvvm::information, QtMvvm::warning, QtMvvm::critical, MessageConfig,
539+ CoreApp::showDialog
540+ */
541+
542+ /*!
543+ @fn QtMvvm::question(const QString &, const QString &, const std::function<void(bool)> &, const QString &, const QString &)
544+
545+ @param onResult A handler to be called when the message box has been closed. The parameter is
546+ `true` if the user pressed YES, `false` if he pressed NO or cancled the dialog
547+ @copydetails QtMvvm::question(const QString &, const QString &, const QString &, const QString &)
548+ */
549+
550+ /*!
551+ @fn QtMvvm::question(const QString &, const QString &, QObject *, const std::function<void(bool)> &, const QString &, const QString &)
552+
553+ @param scope A scope to limit to. `onResult` is only called as long as scope has not been deleted
554+ @copydetails QtMvvm::question(const QString &, const QString &, const std::function<void(bool)> &, const QString &, const QString &)
555+ */
556+
557+ /*!
558+ @fn QtMvvm::warning(const QString &, const QString &, const QString &)
559+
560+ @param title The messagebox title (MessageConfig::title)
561+ @param text The primary message text (MessageConfig::text)
562+ @param okText An optional text overwrite for the OK button (MessageConfig::buttonTexts)
563+
564+ Shows a simple warning dialog with a title, a text and the OK button present.
565+
566+ @sa QtMvvm::question, QtMvvm::information, QtMvvm::critical, MessageConfig,
567+ CoreApp::showDialog
568+ */
569+
570+ /*!
571+ @fn QtMvvm::warning(const QString &, const QString &, const std::function<void()> &, const QString &)
572+
573+ @param onResult A handler to be called when the message box has been closed
574+ @copydetails QtMvvm::warning(const QString &, const QString &, const QString &)
575+ */
576+
577+ /*!
578+ @fn QtMvvm::warning(const QString &, const QString &, QObject *, const std::function<void()> &, const QString &)
579+
580+ @param scope A scope to limit to. `onResult` is only called as long as scope has not been deleted
581+ @copydetails QtMvvm::warning(const QString &, const QString &, const std::function<void()> &, const QString &)
582+ */
583+
584+ /*!
585+ @fn QtMvvm::critical(const QString &, const QString &, const QString &)
586+
587+ @param title The messagebox title (MessageConfig::title)
588+ @param text The primary message text (MessageConfig::text)
589+ @param okText An optional text overwrite for the OK button (MessageConfig::buttonTexts)
590+
591+ Shows a simple critical error dialog with a title, a text and the OK button present.
592+
593+ @sa QtMvvm::question, QtMvvm::warning, QtMvvm::information, MessageConfig,
594+ CoreApp::showDialog
595+ */
596+
597+ /*!
598+ @fn QtMvvm::critical(const QString &, const QString &, const std::function<void()> &, const QString &)
599+
600+ @param onResult A handler to be called when the message box has been closed
601+ @copydetails QtMvvm::critical(const QString &, const QString &, const QString &)
602+ */
603+
604+ /*!
605+ @fn QtMvvm::critical(const QString &, const QString &, QObject *, const std::function<void()> &, const QString &)
606+
607+ @param scope A scope to limit to. `onResult` is only called as long as scope has not been deleted
608+ @copydetails QtMvvm::critical(const QString &, const QString &, const std::function<void()> &, const QString &)
609+ */
610+
611+ /*!
612+ @fn QtMvvm::about(const QString &, const QUrl &, const QString &, const QUrl &, const QString &, bool, const QStringList &, const QString &)
613+
614+ @param description A short descriptive text what your application is all about
615+ @param websiteUrl The URL to your website
616+ @param licenseName The name of the License you are using
617+ @param licenseUrl A URL to an online (or offline) variant of the license to read
618+ for the user
619+ @param companyName The name of your company or your name as creator of the application
620+ @param addQtVersion Specify whether the Qt Version should be visible as part of the about
621+ dialog
622+ @param extraTopInfos Additional short texts to be shown below the version
623+ @param extraBottomInfos An additional text to be shown at the bottom of the dialog
624+
625+ Creates an advanced about dialog out of all of this information in an organized manner. The
626+ `extraTopInfos` are ment as short extra information about configurations etc, for example a
627+ specific plattform plugin used, as selected style or further important links. The
628+ `extraBottomInfos` can be a long and rich text with anything else you want to put in the about
629+ dialog that is not applicabale for the previous part (for example a list of contributers).
630+
631+ @note All the texts can be richtext (HTML). But be aware that they are already beeing wrapped
632+ in `<p></p>` blocks. Furthermore, QML only supports a small subset of HTML in the default text
633+ mode that is used.
634+
635+ @sa QtMvvm::information, MessageConfig, CoreApp::showDialog
636+ */
0 commit comments