summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-10-26 20:12:00 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-11-16 15:17:19 +0100
commite5f777638b6a32adc6245bf276af9c887b4c9b0f (patch)
tree49289aa0e60fe30486199e8a778e085f16f6776b /src/gui/kernel
parent91170aba0f465f9881483bcb93f319d608528002 (diff)
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 <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qplatformdialoghelper.cpp12
-rw-r--r--src/gui/kernel/qplatformdialoghelper.h3
2 files changed, 15 insertions, 0 deletions
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 <QtCore/QUrl>
#include <QtCore/QVariant>
#include <QtGui/QColor>
+#include <QtGui/QPixmap>
#include <algorithm>
@@ -774,6 +775,7 @@ public:
QPlatformDialogHelper::StandardButtons buttons;
QList<QMessageDialogOptions::CustomButton> 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;