diff options
author | Raul Metsma <raul@innovaatik.ee> | 2010-12-21 11:55:49 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-12-21 12:01:12 (GMT) |
commit | 482e924154a57cf2e37d8224d3c677635aa56317 (patch) | |
tree | 7fb5df6bea1308bb377e2a99bf6f38c8c2bbf31e /tests/auto/qmessagebox | |
parent | ea48f884704162265791aa14c5d3e1ef4f8ddb4e (diff) | |
download | Qt-482e924154a57cf2e37d8224d3c677635aa56317.zip Qt-482e924154a57cf2e37d8224d3c677635aa56317.tar.gz Qt-482e924154a57cf2e37d8224d3c677635aa56317.tar.bz2 |
QMessageBox wrong Show/Hide Details button label
On LanguageChange event QMessageBox switches Show/Hide Details button
label
Customer portal case id: 00217646
Merge-request: 973
Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
Diffstat (limited to 'tests/auto/qmessagebox')
-rw-r--r-- | tests/auto/qmessagebox/tst_qmessagebox.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
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; |