A configuration for a simple dialog to be shown from the core code. More...
#include <message.h>
Public Types | |
enum | StandardButton { NoButton = 0x00000000, Ok = 0x00000400, Save = 0x00000800, SaveAll = 0x00001000, Open = 0x00002000, Yes = 0x00004000, YesToAll = 0x00008000, No = 0x00010000, NoToAll = 0x00020000, Abort = 0x00040000, Retry = 0x00080000, Ignore = 0x00100000, Close = 0x00200000, Cancel = 0x00400000, Discard = 0x00800000, Help = 0x01000000, Apply = 0x02000000, Reset = 0x04000000, RestoreDefaults = 0x08000000 } |
The Possible Buttons a dialog can have. More... | |
Static Public Attributes | |
Possible standard values for MessageConfig::type | |
static const QByteArray | TypeMessageBox |
A type to show a standard message box. More... | |
static const QByteArray | TypeInputDialog |
A type to show a generic input dialog. More... | |
static const QByteArray | TypeFileDialog |
A type to show a generic file dialog. More... | |
static const QByteArray | TypeColorDialog |
A type to show a generic color dialog. More... | |
static const QByteArray | TypeProgressDialog |
A type to show a generic progress dialog. More... | |
Possible values for MessageConfig::subType when using the type MessageConfig::TypeMessageBox | |
static const QByteArray | SubTypeInformation |
A subType to show an information message. More... | |
static const QByteArray | SubTypeWarning |
A subType to show a warning message. More... | |
static const QByteArray | SubTypeCritical |
A subType to show a critical error message. More... | |
static const QByteArray | SubTypeQuestion |
A subType to show a question message. More... | |
static const QByteArray | SubTypeAbout |
A subType to show an about dialog. More... | |
Possible values for MessageConfig::subType when using the type MessageConfig::TypeFileDialog | |
static const QByteArray | SubTypeDir |
A subType to show an open directory dialog. More... | |
static const QByteArray | SubTypeOpenFile |
A subType for to show an open file dialog. More... | |
static const QByteArray | SubTypeOpenFiles |
A subType for to show an open files dialog. More... | |
static const QByteArray | SubTypeSaveFile |
A subType for to show a save file dialog. More... | |
Possible values for MessageConfig::subType when using the type MessageConfig::TypeColorDialog | |
static const QByteArray | SubTypeRgb |
A subType to show a color dialog without an alpha channel. More... | |
static const QByteArray | SubTypeArgb |
A subType to show a color dialog with an alpha channel. More... | |
Possible values for MessageConfig::subType when using the type MessageConfig::TypeProgressDialog | |
static const QByteArray | SubTypeProgress |
A subType to show a dialog with a progress bar. More... | |
static const QByteArray | SubTypeBusy |
A subType to show a dialog with a busy indicator. More... | |
Properties | |
QByteArray | type |
The general type of dialog to be shown. More... | |
QByteArray | subType |
A subtype for the dialog to specify what exactly it should show. More... | |
QString | title |
The dialog title or window title. More... | |
QString | text |
The primary text/message to be displayed. More... | |
StandardButtons | buttons |
The available buttons a user may press. More... | |
QVariantMap | buttonTexts |
A map of name overwrites for the texts shown on buttons. More... | |
QVariant | defaultValue |
A default value for dialogs that take some kind of input. More... | |
QVariantMap | viewProperties |
Additional properties to be set on the created views. More... | |
A configuration for a simple dialog to be shown from the core code.
You can use the configuration to show simple dialogs from the core application. Typically, you can use the wrapper methods, but for more advanced dialogs you may need to create a message config explicitly.
The Possible Buttons a dialog can have.
|
static |
A subType to show an about dialog.
Value: "about"
An about dialog is a simple informative dialog showing information about the application in a neutral manner, but in a sligthly different style than a simple information message.
|
static |
A subType to show a color dialog with an alpha channel.
Value: "argb"
A color dialog that lets the user select a color, including the alpha channel. Please note that not all native dialogs support alpha channel editing.
|
static |
A subType to show a dialog with a busy indicator.
Value: "busy"
A dialog with a busy indicator shown. This indicator can and will always only show an indeterminate progress, other values of the ProgressControl are ignored. On platforms that do not have a seperate busy indicator, an indeterminate progress bar can be shown.
|
static |
A subType to show a critical error message.
Value: "critical"
An critical message box typically shows a critical and often unrecoverable error.
|
static |
A subType to show an open directory dialog.
Value: "dir"
A file dialog to open a directory lets the user select a single, existing directory. Depending on the platform he might be able to create a new directory via the dialog, but he can only select an existing one.
|
static |
A subType to show an information message.
Value: "information"
An information message box typically shows a neutral/positiv information.
|
static |
A subType for to show an open file dialog.
Value: "open"
A file dialog to open a file lets the user select a single, existing file.
|
static |
A subType for to show an open files dialog.
Value: "files"
A file dialog to open multiple files lets the user select a list of existing files. They can be in different folders, if the platform allows this.
|
static |
A subType to show a dialog with a progress bar.
Value: "progress"
A dialog with a standard progess bar. This bar can either display a classical progress with min, max and value, or be shown as indeterminate progress (can be switched dynamically via the ProgressControl)
|
static |
A subType to show a question message.
Value: "question"
An question message box typically asks the user a simple Yes-No question he can reply using the buttons.
|
static |
A subType to show a color dialog without an alpha channel.
Value: "rgb"
A color dialog that lets the user select a color, without allowing editing of the alpha channel. The alpha channel will always be set to 0xFF
, i.e. non transparent.
|
static |
A subType for to show a save file dialog.
Value: "save"
A file dialog to save a file lets the user select a single file to be created or overwritten to save content to it.
|
static |
A subType to show a warning message.
Value: "warning"
An warning message box typically shows a (non critical) warning.
|
static |
A type to show a generic color dialog.
Value: "color"
Shows a generic color dialog. If possible, this will use the systems default, otherwise a simple color picker gui.
Dialog Type | subType value |
---|---|
Select a color without alpha | MessageConfig::SubTypeRgb |
Select a color with alpha | MessageConfig::SubTypeArgb |
|
static |
A type to show a generic file dialog.
Value: "file"
Shows a generic file dialog utilizing the operating systems default file dialogs in order to show a native dialog the user can use to select files or directories
Dialog Type | subType value |
---|---|
Open Directory | MessageConfig::SubTypeDir |
Open File | MessageConfig::SubTypeOpenFile |
Open Files | MessageConfig::SubTypeOpenFiles |
Save File | MessageConfig::SubTypeSaveFile |
|
static |
A type to show a generic input dialog.
Value: "input"
Shows a generic input dialog with a title and a short label, together with some kind of edit view in order to input a single value. The datatype to get as well as the kind of input view to create is determined by MessageConfig:subType. Theoretically, and type that can be passed via QVariant can be used as input value. However, only for the most common types do default edit views exist. In case you want to use types not present in the list below, you need to create edit views yourself
Type | Widgets edit | Quick edit | Quick delegate |
---|---|---|---|
bool | QCheckBox | CheckBox | BoolDelegate |
switch | QCheckBox | Switch | SwitchDelegate |
QString, string | QLineEdit | TextField | MsgDelegate (*) |
int | QSpinBox | SpinBox | MsgDelegate |
double, number | QDoubleSpinBox | DoubleSpinBox | MsgDelegate |
range (int) | QSlider | Slider | RangeDelegate |
QDate | QDateEdit | DateEdit | MsgDelegate |
QTime | QTimeEdit | TimeEdit | MsgDelegate |
QDateTime, date | QDateTimeEdit | DateTimeEdit | MsgDelegate |
QColor, color | ColorButton | ColorEdit | ColorDelegate |
QFont, font | QFontComboBox | FontEdit | MsgDelegate |
QKeySequence | QKeySequenceEdit | -/- | -/- |
QUrl, url | QLineEdit with QUrlValidator | UrlField | MsgDelegate |
selection, list | QComboBox | ListEdit | ListDelegate |
radiolist | -/- | RadioListEdit | -/- |
action (settings only) | QPushButton | -/- | ItemDelegate |
(*) The MsgDelegate is used for any type but the ones that have explicit delegates. It will show a dialog with an input of the "Quick edit" column
The following types have special properties as well:
regexp
: A regular expression pattern (QString) to be used as input validator for the textpatternOptions
: QRegularExpression::PatternOptions as options for the regular expressionallowedSchemes
: A QStringList with allowed schemes for the URLlistElements
: A list of elemets the user can select from. Can either be:
|
static |
A type to show a standard message box.
Value: "msgbox"
Shows a generic message box with a title and primary text to inform the user of some kind of event or ask him a question. The MessageConfig:subType is used to determine the kind of message to show:
Message Type | subType value |
---|---|
Information | MessageConfig::SubTypeInformation |
Question | MessageConfig::SubTypeWarning |
Warning | MessageConfig::SubTypeCritical |
Critical Error | MessageConfig::SubTypeQuestion |
About Dialog | MessageConfig::SubTypeAbout |
The widgets implementation does support a few extra properties for this type:
|
static |
A type to show a generic progress dialog.
Value: "progress"
Shows a generic progress dialog. The dialog can by dynamically and asynchronously controlled from the core app via the ProgressControl class. You must pass an instance of a ProgressControl via the MessageConfig::defaultValue property when creating one yourself. The passed control will automatically be connected to the corresponding dialog.
Dialog Type | subType value |
---|---|
Display a progress bar | MessageConfig::SubTypeProgress |
Display a busy indicator | MessageConfig::SubTypeBusy |
|
readwrite |
The available buttons a user may press.
Default: Depends on the type used
The buttons are the buttons in the dialog to "complete" it. Use these flags to select the buttons the user can click on. Each button will close the dialog and be reported back via the MessageResult::dialogDone signal.
Accessors | |
---|---|
READ | buttons() |
WRITE | setButtons() |
WRITE | addButton() |
RESET | resetButtons() |
|
readwrite |
A map of name overwrites for the texts shown on buttons.
Default: Empty
All buttons in this map will be shown in addition to the ones in the MessageConfig::buttons property. The will keep their role, but show the text specified in the map instead of their normal text.
Accessors | |
---|---|
READ | buttonTexts() |
WRITE | setButtonTexts() |
WRITE | setButtonText() |
RESET | resetButtons() |
|
readwrite |
A default value for dialogs that take some kind of input.
Default: Invalid
Some dialogs allow the users to enter some kind of result besides of the buttons they can press. For such dialogs, this property can be used to provide the input with a default value. For others, this may serve as a hint for the input.
Accessors | |
---|---|
READ | defaultValue() |
WRITE | setDefaultValue() |
|
readwrite |
A subtype for the dialog to specify what exactly it should show.
Default: Depends on the type used
The subType is a finer specification of what kind of dialog to show. It depends on the MessageConfig::type that is used. The possible valid subtypes depend on the MessageConfig::type used.
It is possible to define your own subtypes, but that means you have to customize the presenters to add support for those dialogs.
The subtypes supported by default are:
QString
, int
, ...Accessors | |
---|---|
READ | subType() |
WRITE | setSubType() |
RESET | resetSubType() |
|
readwrite |
|
readwrite |
The dialog title or window title.
Default: Emtpy
The title is typically bigger then the rest of the text and serves as a short text to hint the content. Depending on the platform and type it may be shown as window title or other kind of decorative text.
Accessors | |
---|---|
READ | title() |
WRITE | setTitle() |
|
readwrite |
The general type of dialog to be shown.
Default: MessageConfig::TypeMessageBox
The type determines what kind of dialog is show. The type is a general category of dialogs. The MessageConfig::subType is used to set the final type of dialog shown. It's interpretation depends on the type used.
It is possible to define your own types, but that means you have to customize the presenters to add support for those dialogs.
The types supported by default are:
Accessors | |
---|---|
READ | type() |
WRITE | setType() |
|
readwrite |
Additional properties to be set on the created views.
Default: Empty
The view properties are additional properties to be set on the created views. This allows you to configure the appearance of the dialog from within the core code.
Accessors | |
---|---|
READ | viewProperties() |
WRITE | setViewProperties() |
WRITE | setViewProperty() |