summaryrefslogtreecommitdiff
path: root/src/gui/dialogs/qmessagebox.cpp
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2011-07-04 15:50:14 +0300
committerSami Merila <sami.merila@nokia.com>2011-07-04 15:50:14 +0300
commit39b598cbf387e3939d7a9e72b5e69b59839ae473 (patch)
tree2e98fb879718095573928fdd1ef258de5a446d5c /src/gui/dialogs/qmessagebox.cpp
parent685d89b68dd11263d53a2c0982f057965f7262f2 (diff)
downloadqt4-tools-39b598cbf387e3939d7a9e72b5e69b59839ae473.tar.gz
On symbian QMessageBox icon is on different side than in native dialog
In Symbian dialogs have layout (on LeftToRight UIs) where icon is on the right and text on left. Whereas, Qt by default has icon on the left and text on the right. Fix Qt dialogs to behave like native ones on Symbian. Task-number: QTBUG-9924 Reviewed-by: Tomi Vihria
Diffstat (limited to 'src/gui/dialogs/qmessagebox.cpp')
-rw-r--r--src/gui/dialogs/qmessagebox.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/dialogs/qmessagebox.cpp b/src/gui/dialogs/qmessagebox.cpp
index 7d209fb7ac..6a1c04a70f 100644
--- a/src/gui/dialogs/qmessagebox.cpp
+++ b/src/gui/dialogs/qmessagebox.cpp
@@ -259,8 +259,15 @@ void QMessageBoxPrivate::init(const QString &title, const QString &text)
QGridLayout *grid = new QGridLayout;
#ifndef Q_WS_MAC
- grid->addWidget(iconLabel, 0, 0, 2, 1, Qt::AlignTop);
- grid->addWidget(label, 0, 1, 1, 1);
+#ifdef Q_WS_S60
+ const int preferredIconColumn = (QApplication::layoutDirection() == Qt::LeftToRight) ? 1 : 0;
+ const int preferredTextColumn = (QApplication::layoutDirection() == Qt::LeftToRight) ? 0 : 1;
+#else
+ const int preferredIconColumn = 0;
+ const int preferredTextColumn = 1;
+#endif
+ grid->addWidget(iconLabel, 0, preferredIconColumn, 2, 1, Qt::AlignTop);
+ grid->addWidget(label, 0, preferredTextColumn, 1, 1);
// -- leave space for information label --
grid->addWidget(buttonBox, 2, 0, 1, 2);
#else