maxLibQt
|
A simple message box with a large scrollable area (a QTextEdit
) for detailed text (including HTML formatting).
More...
#include "ScrollableMessageBox.h"
Inherits QDialog.
Public Types | |
enum | CustomButton { ShowDetails = 0x01 } |
Public Types inherited from QDialog | |
enum | DialogCode |
Public Types inherited from QWidget | |
enum | RenderFlag |
Public Types inherited from QPaintDevice | |
enum | PaintDeviceMetric |
Public Member Functions | |
ScrollableMessageBox (QWidget *parent=nullptr, Qt::WindowFlags f=Qt::Dialog) | |
ScrollableMessageBox (const QString &title, const QString &text=QString(), const QString &details=QString(), QWidget *parent=nullptr, Qt::WindowFlags f=Qt::Dialog) | |
ScrollableMessageBox (const QString &title, QMessageBox::Icon icon, const QString &text, const QString &details=QString(), QWidget *parent=nullptr, Qt::WindowFlags f=Qt::Dialog) | |
ScrollableMessageBox (QWidget *parent, const QString &title, const QString &text, const QString &details, int buttons, int defaultButtton=QDialogButtonBox::NoButton, Qt::WindowFlags f=Qt::Dialog) | |
buttons and defaultButtton can be QDialogButtonBox::StandardButton or QMessageBox::StandardButton enum values, or the special ScrollableMessageBox::ShowDetails button value. More... | |
ScrollableMessageBox (QWidget *parent, const QString &title, QMessageBox::Icon icon, const QString &text, const QString &details, int buttons, int defaultButtton=QDialogButtonBox::NoButton, Qt::WindowFlags f=Qt::Dialog) | |
buttons and defaultButtton can be QDialogButtonBox::StandardButton or QMessageBox::StandardButton enum values, or the special ScrollableMessageBox::ShowDetails button value. More... | |
QDialogButtonBox * | buttonBox () const |
The dialog's button box. Buttons could be added/removed directly, and its signals can be connected to in order to determine which button was pressed, etc. More... | |
bool | detailsButtonVisible () const |
Returns true if the "show details" button is shown, false otherwise. More... | |
bool | detailsExpanded () const |
Returns true if the details text is currently visible, false otherwise. More... | |
QLabel * | iconLabel () const |
The QLabel which holds the icon. It is recommended to use setIcon() instead of setting the pixmap directly as that will also adjust the layout size properly. More... | |
QLabel * | promptLabel () |
The QLabel which holds a prompt shown just above the buttons. This is created lazily if needed. More... | |
QTextEdit * | textEdit () const |
The QTextEdit which holds the detailed text. It is recommended to use setDetailedText() instead of setting the text directly as that will also adjust the dialog size if necessary. More... | |
QLabel * | textLabel () const |
The QLabel which holds the text. It is recommended to use setText() instead of setting the label text directly as that will also adjust the dialog size if necessary. More... | |
Public Member Functions inherited from QDialog | |
QDialog (QWidget *parent, Qt::WindowFlags f) | |
virtual | ~QDialog () |
virtual void | accept () |
void | accepted () |
virtual void | done (int r) |
virtual int | exec () |
QWidget * | extension () const const |
void | finished (int result) |
bool | isSizeGripEnabled () const const |
virtual const QMetaObject * | metaObject () const const |
virtual QSize | minimumSizeHint () const const override |
virtual void | open () |
Qt::Orientation | orientation () const const |
virtual int | qt_metacall (QMetaObject::Call, int, void **) |
virtual void * | qt_metacast (const char *) |
virtual void | reject () |
void | rejected () |
int | result () const const |
void | setExtension (QWidget *extension) |
void | setModal (bool modal) |
void | setOrientation (Qt::Orientation orientation) |
void | setResult (int i) |
void | setSizeGripEnabled (bool) |
virtual void | setVisible (bool visible) override |
void | showExtension (bool showIt) |
virtual QSize | sizeHint () const const override |
Public Member Functions inherited from QWidget | |
QWidget (QWidget *parent, Qt::WindowFlags f) | |
virtual | ~QWidget () |
bool | acceptDrops () const const |
QString | accessibleDescription () const const |
QString | accessibleName () const const |
QList< QAction * > | actions () const const |
void | activateWindow () |
void | addAction (QAction *action) |
void | addActions (QList< QAction * > actions) |
void | adjustSize () |
bool | autoFillBackground () const const |
QPalette::ColorRole | backgroundRole () const const |
QBackingStore * | backingStore () const const |
QSize | baseSize () const const |
QWidget * | childAt (const QPoint &p) const const |
QWidget * | childAt (int x, int y) const const |
QRect | childrenRect () const const |
QRegion | childrenRegion () const const |
void | clearFocus () |
void | clearMask () |
bool | close () |
QMargins | contentsMargins () const const |
QRect | contentsRect () const const |
Qt::ContextMenuPolicy | contextMenuPolicy () const const |
QCursor | cursor () const const |
void | customContextMenuRequested (const QPoint &pos) |
WId | effectiveWinId () const const |
void | ensurePolished () const const |
Qt::FocusPolicy | focusPolicy () const const |
QWidget * | focusProxy () const const |
QWidget * | focusWidget () const const |
const QFont & | font () const const |
QFontInfo | fontInfo () const const |
QFontMetrics | fontMetrics () const const |
QPalette::ColorRole | foregroundRole () const const |
QRect | frameGeometry () const const |
QSize | frameSize () const const |
const QRect & | geometry () const const |
void | getContentsMargins (int *left, int *top, int *right, int *bottom) const const |
QPixmap | grab (const QRect &rectangle) |
void | grabGesture (Qt::GestureType gesture, Qt::GestureFlags flags) |
void | grabKeyboard () |
void | grabMouse () |
void | grabMouse (const QCursor &cursor) |
int | grabShortcut (const QKeySequence &key, Qt::ShortcutContext context) |
QGraphicsEffect * | graphicsEffect () const const |
QGraphicsProxyWidget * | graphicsProxyWidget () const const |
bool | hasEditFocus () const const |
bool | hasFocus () const const |
virtual bool | hasHeightForWidth () const const |
bool | hasMouseTracking () const const |
bool | hasTabletTracking () const const |
int | height () const const |
virtual int | heightForWidth (int w) const const |
void | hide () |
Qt::InputMethodHints | inputMethodHints () const const |
virtual QVariant | inputMethodQuery (Qt::InputMethodQuery query) const const |
void | insertAction (QAction *before, QAction *action) |
void | insertActions (QAction *before, QList< QAction * > actions) |
bool | isActiveWindow () const const |
bool | isAncestorOf (const QWidget *child) const const |
bool | isEnabled () const const |
bool | isEnabledTo (const QWidget *ancestor) const const |
bool | isEnabledToTLW () const const |
bool | isFullScreen () const const |
bool | isHidden () const const |
bool | isMaximized () const const |
bool | isMinimized () const const |
bool | isModal () const const |
bool | isTopLevel () const const |
bool | isVisible () const const |
bool | isVisibleTo (const QWidget *ancestor) const const |
bool | isWindow () const const |
bool | isWindowModified () const const |
QLayout * | layout () const const |
Qt::LayoutDirection | layoutDirection () const const |
QLocale | locale () const const |
void | lower () |
QPoint | mapFrom (const QWidget *parent, const QPoint &pos) const const |
QPoint | mapFromGlobal (const QPoint &pos) const const |
QPoint | mapFromParent (const QPoint &pos) const const |
QPoint | mapTo (const QWidget *parent, const QPoint &pos) const const |
QPoint | mapToGlobal (const QPoint &pos) const const |
QPoint | mapToParent (const QPoint &pos) const const |
QRegion | mask () const const |
int | maximumHeight () const const |
QSize | maximumSize () const const |
int | maximumWidth () const const |
int | minimumHeight () const const |
QSize | minimumSize () const const |
int | minimumWidth () const const |
void | move (int x, int y) |
void | move (const QPoint &) |
QWidget * | nativeParentWidget () const const |
QWidget * | nextInFocusChain () const const |
QRect | normalGeometry () const const |
void | overrideWindowFlags (Qt::WindowFlags flags) |
virtual QPaintEngine * | paintEngine () const const override |
const QPalette & | palette () const const |
QWidget * | parentWidget () const const |
QPoint | pos () const const |
QWidget * | previousInFocusChain () const const |
void | raise () |
QRect | rect () const const |
void | releaseKeyboard () |
void | releaseMouse () |
void | releaseShortcut (int id) |
void | removeAction (QAction *action) |
void | render (QPainter *painter, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags) |
void | render (QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags) |
void | repaint () |
void | repaint (int x, int y, int w, int h) |
void | repaint (const QRect &rect) |
void | repaint (const QRegion &rgn) |
void | resize (int w, int h) |
void | resize (const QSize &) |
bool | restoreGeometry (const QByteArray &geometry) |
QByteArray | saveGeometry () const const |
void | scroll (int dx, int dy) |
void | scroll (int dx, int dy, const QRect &r) |
void | setAcceptDrops (bool on) |
void | setAccessibleDescription (const QString &description) |
void | setAccessibleName (const QString &name) |
void | setAttribute (Qt::WidgetAttribute attribute, bool on) |
void | setAutoFillBackground (bool enabled) |
void | setBackgroundRole (QPalette::ColorRole role) |
void | setBaseSize (int basew, int baseh) |
void | setBaseSize (const QSize &) |
void | setContentsMargins (int left, int top, int right, int bottom) |
void | setContentsMargins (const QMargins &margins) |
void | setContextMenuPolicy (Qt::ContextMenuPolicy policy) |
void | setCursor (const QCursor &) |
void | setDisabled (bool disable) |
void | setEditFocus (bool enable) |
void | setEnabled (bool) |
void | setFixedHeight (int h) |
void | setFixedSize (int w, int h) |
void | setFixedSize (const QSize &s) |
void | setFixedWidth (int w) |
void | setFocus () |
void | setFocus (Qt::FocusReason reason) |
void | setFocusPolicy (Qt::FocusPolicy policy) |
void | setFocusProxy (QWidget *w) |
void | setFont (const QFont &) |
void | setForegroundRole (QPalette::ColorRole role) |
void | setGeometry (const QRect &) |
void | setGeometry (int x, int y, int w, int h) |
void | setGraphicsEffect (QGraphicsEffect *effect) |
void | setHidden (bool hidden) |
void | setInputMethodHints (Qt::InputMethodHints hints) |
void | setLayout (QLayout *layout) |
void | setLayoutDirection (Qt::LayoutDirection direction) |
void | setLocale (const QLocale &locale) |
void | setMask (const QBitmap &bitmap) |
void | setMask (const QRegion ®ion) |
void | setMaximumHeight (int maxh) |
void | setMaximumSize (const QSize &) |
void | setMaximumSize (int maxw, int maxh) |
void | setMaximumWidth (int maxw) |
void | setMinimumHeight (int minh) |
void | setMinimumSize (const QSize &) |
void | setMinimumSize (int minw, int minh) |
void | setMinimumWidth (int minw) |
void | setMouseTracking (bool enable) |
void | setPalette (const QPalette &) |
void | setParent (QWidget *parent) |
void | setParent (QWidget *parent, Qt::WindowFlags f) |
void | setShortcutAutoRepeat (int id, bool enable) |
void | setShortcutEnabled (int id, bool enable) |
void | setSizeIncrement (const QSize &) |
void | setSizeIncrement (int w, int h) |
void | setSizePolicy (QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical) |
void | setSizePolicy (QSizePolicy) |
void | setStatusTip (const QString &) |
void | setStyle (QStyle *style) |
void | setStyleSheet (const QString &styleSheet) |
void | setTabletTracking (bool enable) |
void | setToolTip (const QString &) |
void | setToolTipDuration (int msec) |
void | setUpdatesEnabled (bool enable) |
void | setupUi (QWidget *widget) |
void | setWhatsThis (const QString &) |
void | setWindowFilePath (const QString &filePath) |
void | setWindowFlag (Qt::WindowType flag, bool on) |
void | setWindowFlags (Qt::WindowFlags type) |
void | setWindowIcon (const QIcon &icon) |
void | setWindowIconText (const QString &) |
void | setWindowModality (Qt::WindowModality windowModality) |
void | setWindowModified (bool) |
void | setWindowOpacity (qreal level) |
void | setWindowRole (const QString &role) |
void | setWindowState (Qt::WindowStates windowState) |
void | setWindowTitle (const QString &) |
void | show () |
void | showFullScreen () |
void | showMaximized () |
void | showMinimized () |
void | showNormal () |
QSize | size () const const |
QSize | sizeIncrement () const const |
QSizePolicy | sizePolicy () const const |
void | stackUnder (QWidget *w) |
QString | statusTip () const const |
QStyle * | style () const const |
QString | styleSheet () const const |
bool | testAttribute (Qt::WidgetAttribute attribute) const const |
QString | toolTip () const const |
int | toolTipDuration () const const |
QWidget * | topLevelWidget () const const |
bool | underMouse () const const |
void | ungrabGesture (Qt::GestureType gesture) |
void | unsetCursor () |
void | unsetLayoutDirection () |
void | unsetLocale () |
void | update () |
void | update (const QRegion &rgn) |
void | update (int x, int y, int w, int h) |
void | update (const QRect &rect) |
void | updateGeometry () |
bool | updatesEnabled () const const |
QRegion | visibleRegion () const const |
QString | whatsThis () const const |
int | width () const const |
QWidget * | window () const const |
QString | windowFilePath () const const |
Qt::WindowFlags | windowFlags () const const |
QWindow * | windowHandle () const const |
QIcon | windowIcon () const const |
void | windowIconChanged (const QIcon &icon) |
QString | windowIconText () const const |
void | windowIconTextChanged (const QString &iconText) |
Qt::WindowModality | windowModality () const const |
qreal | windowOpacity () const const |
QString | windowRole () const const |
Qt::WindowStates | windowState () const const |
QString | windowTitle () const const |
void | windowTitleChanged (const QString &title) |
Qt::WindowType | windowType () const const |
WId | winId () const const |
int | x () const const |
int | y () const const |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
const QObjectList & | children () const const |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectInfo () const const |
void | dumpObjectInfo () |
void | dumpObjectTree () const const |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const const |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isWidgetType () const const |
bool | isWindowType () const const |
void | killTimer (int id) |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
QVariant | property (const char *name) const const |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
QThread * | thread () const const |
Public Member Functions inherited from QPaintDevice | |
virtual | ~QPaintDevice () |
int | colorCount () const const |
int | depth () const const |
int | devicePixelRatio () const const |
qreal | devicePixelRatioF () const const |
int | height () const const |
int | heightMM () const const |
int | logicalDpiX () const const |
int | logicalDpiY () const const |
bool | paintingActive () const const |
int | physicalDpiX () const const |
int | physicalDpiY () const const |
int | width () const const |
int | widthMM () const const |
Public Slots | |
void | setDetailedText (const QString &details=QString(), Qt::TextFormat format=Qt::AutoText) |
Set the longer details text shown in the scrollable message pane area. More... | |
void | setDetailsButtonVisible (bool visible=true, bool toggleDetails=true, bool toggleDetailPosition=true) |
Enables or disables showing a "show details" button which toggles visibility of the details text. More... | |
void | setFontFixedWidth (bool fixed=true) |
Changes the font used to display the detailed text to a fixed-width or a proportional font based on fixed value. More... | |
void | setIcon (const QPixmap &pixmap=QPixmap()) |
Set the image displayed next to the message box text label to pixmap. An invalid pixmap value will remove any current icon. More... | |
void | setIcon (QMessageBox::Icon icon, const QSize &size=QSize()) |
Set the image displayed next to the message box text to a standard QMessageBox::Icon icon. More... | |
void | setIcon (const QIcon &icon, const QSize &size=QSize()) |
Set the image displayed next to the message box text to the specified icon. More... | |
void | setIconAlignment (Qt::AlignmentFlag valign) |
Set the vertical alignment of the icon to valign. More... | |
void | setPromptText (const QString &text=QString()) |
Set a message to be shown just above the dialog button(s), below the details text. More... | |
void | setShowDetailsBelowButtons (bool on=true) |
Toggles where the details text is displayed. More... | |
void | setText (const QString &text=QString()) |
Set the text shown at the top of the dialog, before the details text. More... | |
void | setTextWordWrap (bool wrap=true) |
Enable or disable word wrapping for the text message (shorthand for textLabel()->setWordWrap(wrap) ). More... | |
void | setWordWrap (bool wrap=true) |
Enable or disable word wrapping for the detailed text display. More... | |
bool | showDetailsExpanded (bool on=true) |
Sets the details text visibility to on. More... | |
bool | toggleDetailsExpanded () |
Shows the details text if it is currently hidden, and hides it otherwise. More... | |
void | updateSize () |
Recalculates the dialog minimum size after UI element changes like adding/removing buttons. More... | |
Protected Member Functions | |
void | showEvent (QShowEvent *e) override |
Protected Member Functions inherited from QDialog | |
virtual void | closeEvent (QCloseEvent *e) override |
virtual void | contextMenuEvent (QContextMenuEvent *e) override |
virtual bool | eventFilter (QObject *o, QEvent *e) override |
virtual void | keyPressEvent (QKeyEvent *e) override |
virtual void | resizeEvent (QResizeEvent *) override |
Protected Member Functions inherited from QWidget | |
virtual void | actionEvent (QActionEvent *event) |
virtual void | changeEvent (QEvent *event) |
void | create (WId window, bool initializeWindow, bool destroyOldWindow) |
void | destroy (bool destroyWindow, bool destroySubWindows) |
virtual void | dragEnterEvent (QDragEnterEvent *event) |
virtual void | dragLeaveEvent (QDragLeaveEvent *event) |
virtual void | dragMoveEvent (QDragMoveEvent *event) |
virtual void | dropEvent (QDropEvent *event) |
virtual void | enterEvent (QEvent *event) |
virtual bool | event (QEvent *event) override |
virtual void | focusInEvent (QFocusEvent *event) |
bool | focusNextChild () |
virtual bool | focusNextPrevChild (bool next) |
virtual void | focusOutEvent (QFocusEvent *event) |
bool | focusPreviousChild () |
virtual void | hideEvent (QHideEvent *event) |
virtual void | initPainter (QPainter *painter) const const override |
virtual void | inputMethodEvent (QInputMethodEvent *event) |
virtual void | keyReleaseEvent (QKeyEvent *event) |
virtual void | leaveEvent (QEvent *event) |
virtual int | metric (QPaintDevice::PaintDeviceMetric m) const const override |
virtual void | mouseDoubleClickEvent (QMouseEvent *event) |
virtual void | mouseMoveEvent (QMouseEvent *event) |
virtual void | mousePressEvent (QMouseEvent *event) |
virtual void | mouseReleaseEvent (QMouseEvent *event) |
virtual void | moveEvent (QMoveEvent *event) |
virtual bool | nativeEvent (const QByteArray &eventType, void *message, long *result) |
virtual void | paintEvent (QPaintEvent *event) |
virtual void | tabletEvent (QTabletEvent *event) |
void | updateMicroFocus () |
virtual void | wheelEvent (QWheelEvent *event) |
Protected Member Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Protected Member Functions inherited from QPaintDevice | |
QPaintDevice () | |
A simple message box with a large scrollable area (a QTextEdit
) for detailed text (including HTML formatting).
This is a message box dialog for presenting an amount of text which would not comfortably fit in a regular popup message dialog. It addresses the deficiencies found in QMessageBox
with "informative" and/or "detailed" text options, namely its small and fixed size and lack of text formatting for those texts, despite what the documentation states, and forced bold font on the "text" label.
Basic usage is very similar to QMessageBox
. You can set the dialog title, an optional short text message to show at the top, and the larger text block to show as the "details." By default there is only one "OK" button to dismiss the dialog. There is no separate "informative text" like in QMessageBox
– instead just format the text message however you like, with line breaks/paragraphs, fonts, HTML, etc. In QMessageBox
the "informative text" is simply displayed under the "text" anyway.
An icon can be displayed next to the message text, like in a QMessageBox
. Several setIcon()
overloads are available, allowing custom icons, pixmaps, or the standard QMessageBox::Icon
types. Setting an icon will also set the QWidget::windowIcon
for the dialog. The icon can be reset to none by using the setIcon()
method with no argument (this will reset the windowIcon
back to default as well). There are two new constructor overloads available which can specify a standard icon at creation time.
An additional "prompt" label can be used to insert text just above the dialog buttons (for example an "Are you sure?" question). Use setPromptText()
to set the text and and promptLabel()
for direct access to the QLabel
.
A "show details" button can be enabled for the user to toggle, and the details text visibility can be toggled programmatically. Also the details text can be shown below the buttons instead of above, which can be a better arrangement when the user can toggle them. See showDetailsExpanded()
, toggleDetailsExpanded()
, setShowDetailsBelowButtons(), and setDetailsButtonVisible()
for more information.
Two new constructors which let you specify the default dialog button(s) are available. The button values for these can be QDialogButtonBox::StandardButton
or QMessageBox::StandardButton
enum values, or the special ScrollableMessageBox::ShowDetails
button value which will enable the "show details" button described above.
When first shown, the dialog will try to esablish a reasonable size based on the contents of the QTextEdit. The dialog is also fully resizable.
Developers have direct access to the QTextEdit
used for displaying the text, the QLabels
used for the text message and prompt, and the QDialogButtonBox
. There are a couple convenience functions for setting the font style and word wrap on the QTextEdit
. By default a variable-width font is used with word-wrap on.
Definition at line 85 of file ScrollableMessageBox.h.
Enumerator | |
---|---|
ShowDetails | A "Show Details" button which toggles the details text on and off (defined with |
Definition at line 90 of file ScrollableMessageBox.h.
|
explicit |
Definition at line 124 of file ScrollableMessageBox.cpp.
|
explicit |
Definition at line 130 of file ScrollableMessageBox.cpp.
|
explicit |
Definition at line 136 of file ScrollableMessageBox.cpp.
|
explicit |
buttons and defaultButtton can be QDialogButtonBox::StandardButton
or QMessageBox::StandardButton
enum values, or the special ScrollableMessageBox::ShowDetails
button value.
buttons can be any OR'd combination of these flags.
Definition at line 143 of file ScrollableMessageBox.cpp.
|
explicit |
buttons and defaultButtton can be QDialogButtonBox::StandardButton
or QMessageBox::StandardButton
enum values, or the special ScrollableMessageBox::ShowDetails
button value.
buttons can be any OR'd combination of these flags.
Definition at line 149 of file ScrollableMessageBox.cpp.
|
inline |
The dialog's button box. Buttons could be added/removed directly, and its signals can be connected to in order to determine which button was pressed, etc.
Definition at line 117 of file ScrollableMessageBox.h.
bool ScrollableMessageBox::detailsButtonVisible | ( | ) | const |
Returns true
if the "show details" button is shown, false
otherwise.
Definition at line 306 of file ScrollableMessageBox.cpp.
bool ScrollableMessageBox::detailsExpanded | ( | ) | const |
Returns true
if the details text is currently visible, false
otherwise.
Definition at line 276 of file ScrollableMessageBox.cpp.
|
inline |
The QLabel which holds the icon. It is recommended to use setIcon()
instead of setting the pixmap directly as that will also adjust the layout size properly.
Definition at line 115 of file ScrollableMessageBox.h.
QLabel * ScrollableMessageBox::promptLabel | ( | ) |
The QLabel which holds a prompt shown just above the buttons. This is created lazily if needed.
Definition at line 179 of file ScrollableMessageBox.cpp.
|
slot |
Set the longer details text shown in the scrollable message pane area.
Definition at line 163 of file ScrollableMessageBox.cpp.
|
slot |
Enables or disables showing a "show details" button which toggles visibility of the details text.
If toggleDetails is true
(default) then the details text is hidden when visible is true
and shown when visible is false
. If toggleDetailPosition is true
(default) then the details text is moved below the buttons when visible is true
and above them when visible is false
.
Definition at line 311 of file ScrollableMessageBox.cpp.
|
slot |
Changes the font used to display the detailed text to a fixed-width or a proportional font based on fixed value.
Definition at line 236 of file ScrollableMessageBox.cpp.
Set the image displayed next to the message box text label to pixmap. An invalid pixmap value will remove any current icon.
Definition at line 206 of file ScrollableMessageBox.cpp.
|
slot |
Set the image displayed next to the message box text to a standard QMessageBox::Icon
icon.
You can optionally specify a size for the icon as well. The default size is style-specific.
Definition at line 219 of file ScrollableMessageBox.cpp.
Set the image displayed next to the message box text to the specified icon.
You can optionally specify a size for the icon as well. The default size is style-specific.
Definition at line 224 of file ScrollableMessageBox.cpp.
|
slot |
Set the vertical alignment of the icon to valign.
The alignment is in relation to the text label and is only relevant if the text is taller than the icon. Can be one of: Qt::AlignTop
, Qt::AlignVCenter
, Qt::AlignBotton
. is Qt::AlignTop
Definition at line 229 of file ScrollableMessageBox.cpp.
Set a message to be shown just above the dialog button(s), below the details text.
Definition at line 190 of file ScrollableMessageBox.cpp.
|
slot |
Toggles where the details text is displayed.
Set on to true
to display them below the buttons, or false
to show them above the buttons (and above the label set with setPromptText()
). Showing the details below the buttons may be more convenient for the user when the show/hide button is used because toggling it will not make the buttons move.
Definition at line 338 of file ScrollableMessageBox.cpp.
Set the text shown at the top of the dialog, before the details text.
Definition at line 155 of file ScrollableMessageBox.cpp.
|
slot |
Enable or disable word wrapping for the text message (shorthand for textLabel()->setWordWrap(wrap)
).
Definition at line 266 of file ScrollableMessageBox.cpp.
|
slot |
Enable or disable word wrapping for the detailed text display.
Definition at line 258 of file ScrollableMessageBox.cpp.
|
slot |
Sets the details text visibility to on.
Definition at line 281 of file ScrollableMessageBox.cpp.
|
overrideprotectedvirtual |
Reimplemented from QDialog.
Definition at line 459 of file ScrollableMessageBox.cpp.
|
inline |
The QTextEdit which holds the detailed text. It is recommended to use setDetailedText()
instead of setting the text directly as that will also adjust the dialog size if necessary.
Definition at line 111 of file ScrollableMessageBox.h.
|
inline |
The QLabel which holds the text. It is recommended to use setText()
instead of setting the label text directly as that will also adjust the dialog size if necessary.
Definition at line 113 of file ScrollableMessageBox.h.
|
slot |
Shows the details text if it is currently hidden, and hides it otherwise.
Definition at line 299 of file ScrollableMessageBox.cpp.
|
slot |
Recalculates the dialog minimum size after UI element changes like adding/removing buttons.
Optionally call adjustSize()
afterwards to update the dialog geometry to the updated sizeHint()
. This method is called by all the built-in functions which may change the UI size. It is usually not necessary to call this method directly.
Definition at line 429 of file ScrollableMessageBox.cpp.