| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
SimpleDialog Class Reference

Thin wrapper around QMessageBox that can be constructed before Qt is fully initialised, queuing messages for deferred display if necessary. More...

`#include <simple_dialog.h>`

## Public Member Functions
| SimpleDialog (QWidget *parent, ESD_TYPE_E type, int btn_mask, const char *msg_format, va_list ap, QString secondary_msg=QString())
| Constructs a SimpleDialog, building the underlying QMessageBox if Qt is ready, or queuing the message for later display via displayQueuedMessages() if it is not.
| ~SimpleDialog ()
| Destroys the SimpleDialog and the underlying QMessageBox if one was created.
void | setInformativeText (QString text)
| Sets the informative (secondary) text shown below the main message.
void | setDetailedText (QString text)
| Sets the detailed text shown in the expandable details area.
void | setCheckBox (QCheckBox *cb)
| Attaches a check box (e.g. "Don't show this again") to the dialog.
int | exec ()
| Shows the dialog modally and returns the result code of the button that was clicked.
void | show ()
| Shows the dialog modelessly (non-blocking).

## Static Public Member Functions
static void | displayQueuedMessages (QWidget *parent=0)
| Displays any messages that were queued before Qt was initialised.
static QString | dontShowThisAgain ()
| Returns the standard label text for a "Don't show this again" check box.

## Detailed Description

Thin wrapper around QMessageBox that can be constructed before Qt is fully initialised, queuing messages for deferred display if necessary.

Because instances may be created before the Qt event loop is running, this is a plain non-Qt object (no Q_OBJECT macro, no QObject base).

## Constructor & Destructor Documentation

## ◆ SimpleDialog()

SimpleDialog::SimpleDialog | ( | QWidget * | parent,
|  | ESD_TYPE_E | type,
|  | int | btn_mask,
|  | const char * | msg_format,
|  | va_list | ap,
|  | QString | secondary_msg = QString() )
| explicit

Constructs a SimpleDialog, building the underlying QMessageBox if Qt is ready, or queuing the message for later display via displayQueuedMessages() if it is not.

Parameters

  parent | Parent widget for the QMessageBox; may be `nullptr`.
  type | Severity/type of the dialog (ESD_TYPE_INFO, ESD_TYPE_WARN, etc.).
  btn_mask | Bitmask of buttons to show (ESD_BTN_* constants).
  msg_format | printf-style format string for the primary message text.
  ap | Variadic argument list for `msg_format`.
  secondary_msg | Optional secondary (informative) message shown below the primary text.

## Member Function Documentation

## ◆ displayQueuedMessages()

void SimpleDialog::displayQueuedMessages | ( | QWidget * | parent = 0 | ) |
| static

Displays any messages that were queued before Qt was initialised.

Should be called once the Qt event loop is running and a main window is available.

Parameters

  parent | Optional parent widget for the queued message boxes.

## ◆ dontShowThisAgain()

QString SimpleDialog::dontShowThisAgain | ( |  | ) |
| static

Returns the standard label text for a "Don't show this again" check box.

Returns
  Localised "Don't show this again" string.

## ◆ exec()

int SimpleDialog::exec | ( |  | ) |

Shows the dialog modally and returns the result code of the button that was clicked.

Returns
  QDialog::Accepted, QDialog::Rejected, or a QMessageBox::StandardButton value.

## ◆ setCheckBox()

void SimpleDialog::setCheckBox | ( | QCheckBox * | cb | ) |
| inline

Attaches a check box (e.g. "Don't show this again") to the dialog.

Parameters

  cb | Pointer to the QCheckBox to embed; ownership is not transferred.

## ◆ setDetailedText()

void SimpleDialog::setDetailedText | ( | QString | text | ) |
| inline

Sets the detailed text shown in the expandable details area.

Parameters

  text | Detailed text string.

## ◆ setInformativeText()

void SimpleDialog::setInformativeText | ( | QString | text | ) |
| inline

Sets the informative (secondary) text shown below the main message.

Parameters

  text | Informative text string.

The documentation for this class was generated from the following files:

- /builds/wireshark/wireshark/ui/qt/simple_dialog.h
- /builds/wireshark/wireshark/ui/qt/simple_dialog.cpp