From 541949aed23ea14a71a7d4391bac244b623add0a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 21 Feb 2012 15:36:01 +0100 Subject: Add further theme hints to QPlatformTheme. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add hints for QDialog/QDialogButtonBox. - Add hint for available popup-menu area. - Add keyboard scheme hint replacing QGuiApplicationPrivate::currentKeyPlatform() Reviewed-by: Samuel Rødal Reviewed-by: Morten Johan Sørvig Task-number: QTBUG-24204 Task-number: QTBUG-24315 Change-Id: I6653786b0dcb49a6fc264d3b9891dbfee502bd3e Reviewed-by: Friedemann Kleint --- tests/auto/other/languagechange/languagechange.pro | 2 +- tests/auto/other/languagechange/tst_languagechange.cpp | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'tests/auto/other/languagechange') diff --git a/tests/auto/other/languagechange/languagechange.pro b/tests/auto/other/languagechange/languagechange.pro index efbc524556..b115c01641 100644 --- a/tests/auto/other/languagechange/languagechange.pro +++ b/tests/auto/other/languagechange/languagechange.pro @@ -1,4 +1,4 @@ CONFIG += testcase TARGET = tst_languagechange -QT += widgets core-private testlib +QT += widgets core-private gui-private testlib SOURCES += tst_languagechange.cpp diff --git a/tests/auto/other/languagechange/tst_languagechange.cpp b/tests/auto/other/languagechange/tst_languagechange.cpp index b4bd766df7..663f2ef798 100644 --- a/tests/auto/other/languagechange/tst_languagechange.cpp +++ b/tests/auto/other/languagechange/tst_languagechange.cpp @@ -43,13 +43,16 @@ #include #include +#include #include #include #include #include #include +#include #include #include +#include #include #include @@ -66,12 +69,16 @@ private slots: void retranslatability_data(); void retranslatability(); +private: + QDialogButtonBox::ButtonLayout m_layout; }; -tst_languageChange::tst_languageChange() - +tst_languageChange::tst_languageChange() : + m_layout(QDialogButtonBox::WinLayout) { + if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) + m_layout = static_cast(theme->themeHint(QPlatformTheme::DialogButtonBoxLayout).toInt()); } void tst_languageChange::initTestCase() @@ -240,6 +247,9 @@ void tst_languageChange::retranslatability() QFETCH( int, dialogType); QFETCH( TranslationSet, expected); + if (m_layout == QDialogButtonBox::GnomeLayout) + QSKIP("The input data are not suitable for this layout (QDialogButtonBox::GnomeLayout)"); + // This will always be queried for when a language changes expected.insert("QCoreApplication::QT_LAYOUT_DIRECTION::Translate this string to the string 'LTR' in left-to-right " "languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to " -- cgit v1.2.3