From e5f777638b6a32adc6245bf276af9c887b4c9b0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 26 Oct 2022 20:12:00 +0200 Subject: Plumb QMessageBox::iconPixmap() to QPlatformMessageDialogHelper For now this plumbs the QPixmap directly, but as a follow up we should teach QMessageBox to deal with QIcons instead, and rejig the plumbing correspondingly. Change-Id: I51dee4240082abf0acb33b6ade553327295a99bd Reviewed-by: Timur Pocheptsov --- src/gui/kernel/qplatformdialoghelper.cpp | 12 ++++++++++++ src/gui/kernel/qplatformdialoghelper.h | 3 +++ 2 files changed, 15 insertions(+) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/qplatformdialoghelper.cpp b/src/gui/kernel/qplatformdialoghelper.cpp index 0224fb2c61..fbc635cc93 100644 --- a/src/gui/kernel/qplatformdialoghelper.cpp +++ b/src/gui/kernel/qplatformdialoghelper.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include @@ -774,6 +775,7 @@ public: QPlatformDialogHelper::StandardButtons buttons; QList customButtons; int nextCustomButtonId; + QPixmap iconPixmap; }; QMessageDialogOptions::QMessageDialogOptions(QMessageDialogOptionsPrivate *dd) @@ -825,6 +827,16 @@ void QMessageDialogOptions::setIcon(Icon icon) d->icon = icon; } +void QMessageDialogOptions::setIconPixmap(const QPixmap &pixmap) +{ + d->iconPixmap = pixmap; +} + +QPixmap QMessageDialogOptions::iconPixmap() const +{ + return d->iconPixmap; +} + QString QMessageDialogOptions::text() const { return d->text; diff --git a/src/gui/kernel/qplatformdialoghelper.h b/src/gui/kernel/qplatformdialoghelper.h index 83857ba82e..2d3138270f 100644 --- a/src/gui/kernel/qplatformdialoghelper.h +++ b/src/gui/kernel/qplatformdialoghelper.h @@ -416,6 +416,9 @@ public: void setIcon(Icon icon); Icon icon() const; + void setIconPixmap(const QPixmap &pixmap); + QPixmap iconPixmap() const; + void setText(const QString &text); QString text() const; -- cgit v1.2.3