diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-02-21 15:36:01 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-22 17:28:51 +0100 |
commit | 541949aed23ea14a71a7d4391bac244b623add0a (patch) | |
tree | f123b0cfb7d4c42f7b83a378ae670c8b51003057 /tests/auto/other/languagechange | |
parent | 53bb87d1d274a80b94595f6cd31bfa7a8ae81dc3 (diff) |
Add further theme hints to QPlatformTheme.
- Add hints for QDialog/QDialogButtonBox.
- Add hint for available popup-menu area.
- Add keyboard scheme hint replacing
QGuiApplicationPrivate::currentKeyPlatform()
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Task-number: QTBUG-24204
Task-number: QTBUG-24315
Change-Id: I6653786b0dcb49a6fc264d3b9891dbfee502bd3e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'tests/auto/other/languagechange')
-rw-r--r-- | tests/auto/other/languagechange/languagechange.pro | 2 | ||||
-rw-r--r-- | tests/auto/other/languagechange/tst_languagechange.cpp | 14 |
2 files changed, 13 insertions, 3 deletions
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 <QtTest/QtTest> #include <qapplication.h> +#include <private/qguiapplication_p.h> #include <QtCore/QSet> #include <QtCore/QFile> #include <QtCore/QTranslator> #include <QtCore/QTemporaryDir> #include <private/qthread_p.h> +#include <QtGui/QPlatformTheme> #include <QtWidgets/QInputDialog> #include <QtWidgets/QColorDialog> +#include <QtWidgets/QDialogButtonBox> #include <QtWidgets/QFileDialog> #include <QtWidgets/QDesktopWidget> @@ -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<QDialogButtonBox::ButtonLayout>(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 " |