Factory for creating error dialogs from UIError objects.
More...
#include <errorDialogFactory.h>
|
| using | DialogInvoker = std::function<QMessageBox::StandardButton()> |
| | Callable type that shows a dialog when invoked.
|
|
| static DialogInvoker | getDialogFromUIError (const UIError &error, QWidget *parent=nullptr) |
| | Creates a dialog invoker from a UIError.
|
| static std::vector< DialogInvoker > | getDialogsFromUIErrors (const std::vector< UIError > &errors, QWidget *parent=nullptr) |
| | Creates dialog invokers for multiple UIErrors.
|
| static DialogInvoker | getSuccessDialog (const QString &title, const QString &message, QWidget *parent=nullptr) |
| | Creates a success message dialog invoker.
|
| static void | showErrors (const std::vector< UIError > &errors, QWidget *parent=nullptr) |
| | Shows all error dialogs sequentially.
|
| static QMessageBox::StandardButton | showError (const UIError &error, QWidget *parent=nullptr) |
| | Shows a single error dialog immediately.
|
| static void | showSuccess (const QString &title, const QString &message, QWidget *parent=nullptr) |
| | Shows a success message dialog immediately.
|
Factory for creating error dialogs from UIError objects.
Provides static methods to convert UIError objects into QMessageBox dialogs. Supports two modes:
- Deferred: Returns a DialogInvoker callable for later invocation
- Immediate: Shows the dialog right away via convenience methods
- See also
- DialogInvoker
◆ DialogInvoker
Callable type that shows a dialog when invoked.
A DialogInvoker is a packaged dialog that can be invoked at any time. When called, it displays the dialog (blocking) and returns which button the user clicked. Think of it as a "suspended dialog" or "dialog builder" that you can trigger when ready.
- Returns
- The button that was clicked (QMessageBox::StandardButton).
◆ getDialogFromUIError()
Creates a dialog invoker from a UIError.
Returns a callable that, when invoked, shows the error dialog and returns the button clicked by the user.
- Parameters
-
| error | The UIError to display. |
| parent | Parent widget for the dialog. |
- Returns
- A callable that shows the dialog when invoked.
◆ getDialogsFromUIErrors()
Creates dialog invokers for multiple UIErrors.
- Parameters
-
| errors | Vector of UIErrors to convert. |
| parent | Parent widget for all dialogs. |
- Returns
- Vector of callables, one per error.
◆ getSuccessDialog()
Creates a success message dialog invoker.
- Parameters
-
| title | Dialog title. |
| message | Success message body. |
| parent | Parent widget for the dialog. |
- Returns
- A callable that shows the success dialog when invoked.
◆ showError()
| QMessageBox::StandardButton nsbaci::ui::ErrorDialogFactory::showError |
( |
const UIError & | error, |
|
|
QWidget * | parent = nullptr ) |
|
static |
Shows a single error dialog immediately.
- Parameters
-
| error | The UIError to display. |
| parent | Parent widget for the dialog. |
- Returns
- The button that was clicked.
◆ showErrors()
| void nsbaci::ui::ErrorDialogFactory::showErrors |
( |
const std::vector< UIError > & | errors, |
|
|
QWidget * | parent = nullptr ) |
|
static |
Shows all error dialogs sequentially.
Convenience method that creates and immediately shows dialogs for all provided UIErrors.
- Parameters
-
| errors | Vector of UIErrors to display. |
| parent | Parent widget for all dialogs. |
◆ showSuccess()
| void nsbaci::ui::ErrorDialogFactory::showSuccess |
( |
const QString & | title, |
|
|
const QString & | message, |
|
|
QWidget * | parent = nullptr ) |
|
static |
Shows a success message dialog immediately.
- Parameters
-
| title | Dialog title. |
| message | Success message body. |
| parent | Parent widget for the dialog. |
The documentation for this class was generated from the following files: