summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-12-21 21:49:00 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-12-21 21:49:00 (GMT)
commit5e5a637cca3709a64f7dfa4e668a8c9d985e9579 (patch)
tree6e9bc6758acc0ad1ecfdf0c145fdf9df0b9923c6
parentd37a3529ec883985b2967265f0797d749db74308 (diff)
parent482e924154a57cf2e37d8224d3c677635aa56317 (diff)
downloadQt-5e5a637cca3709a64f7dfa4e668a8c9d985e9579.zip
Qt-5e5a637cca3709a64f7dfa4e668a8c9d985e9579.tar.gz
Qt-5e5a637cca3709a64f7dfa4e668a8c9d985e9579.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2: QMessageBox wrong Show/Hide Details button label
-rw-r--r--src/gui/dialogs/qmessagebox.cpp2
-rw-r--r--tests/auto/qmessagebox/tst_qmessagebox.cpp22
2 files changed, 23 insertions, 1 deletions
diff --git a/src/gui/dialogs/qmessagebox.cpp b/src/gui/dialogs/qmessagebox.cpp
index 224a176..af9616d 100644
--- a/src/gui/dialogs/qmessagebox.cpp
+++ b/src/gui/dialogs/qmessagebox.cpp
@@ -1925,7 +1925,7 @@ void QMessageBoxPrivate::retranslateStrings()
{
#ifndef QT_NO_TEXTEDIT
if (detailsButton)
- detailsButton->setLabel(detailsText->isHidden() ? HideLabel : ShowLabel);
+ detailsButton->setLabel(detailsText->isHidden() ? ShowLabel : HideLabel);
#endif
}
diff --git a/tests/auto/qmessagebox/tst_qmessagebox.cpp b/tests/auto/qmessagebox/tst_qmessagebox.cpp
index d4ca064..54d199c 100644
--- a/tests/auto/qmessagebox/tst_qmessagebox.cpp
+++ b/tests/auto/qmessagebox/tst_qmessagebox.cpp
@@ -47,6 +47,7 @@
#include <QTimer>
#include <QApplication>
#include <QPushButton>
+#include <QDialogButtonBox>
#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
#include <QMacStyle>
#endif
@@ -119,6 +120,7 @@ private slots:
void statics();
void about();
void detailsText();
+ void detailsButtonText();
void shortcut();
@@ -661,6 +663,26 @@ void tst_QMessageBox::detailsText()
QCOMPARE(box.detailedText(), text);
}
+void tst_QMessageBox::detailsButtonText()
+{
+ QMessageBox box;
+ box.setDetailedText("bla");
+ box.open();
+ QApplication::postEvent(&box, new QEvent(QEvent::LanguageChange));
+ QApplication::processEvents();
+ QDialogButtonBox* bb = box.findChild<QDialogButtonBox*>("qt_msgbox_buttonbox");
+ QVERIFY(bb); //get the detail button
+
+ QList<QAbstractButton *> list = bb->buttons();
+ QAbstractButton* btn = NULL;
+ foreach(btn, list) {
+ if (btn && (btn->inherits("QPushButton"))) {
+ if(btn->text() != QMessageBox::tr("OK") && btn->text() != QMessageBox::tr("Show Details..."))
+ QFAIL("Incorrect messagebox button text!");
+ }
+ }
+}
+
void tst_QMessageBox::incorrectDefaultButton()
{
keyToSend = Qt::Key_Escape;