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 /src/widgets/styles | |
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 'src/widgets/styles')
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 75476faeeb..174e94e63d 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -83,12 +83,6 @@ # include "private/qtextengine_p.h" #endif -#ifdef Q_WS_X11 -# include <private/qt_x11_p.h> -#elif defined(Q_WS_MAC) -# include <private/qt_cocoa_helpers_mac_p.h> -#endif - #include <private/qstylehelper_p.h> QT_BEGIN_NAMESPACE @@ -4920,12 +4914,8 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget break; case SH_DialogButtonLayout: ret = QDialogButtonBox::WinLayout; -#ifdef Q_WS_X11 - if (X11->desktopEnvironment == DE_KDE) - ret = QDialogButtonBox::KdeLayout; - else if (X11->desktopEnvironment == DE_GNOME) - ret = QDialogButtonBox::GnomeLayout; -#endif + if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) + ret = theme->themeHint(QPlatformTheme::DialogButtonBoxLayout).toInt(); break; case SH_ComboBox_PopupFrameStyle: ret = QFrame::StyledPanel | QFrame::Plain; @@ -4934,10 +4924,9 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget ret = Qt::LinksAccessibleByMouse; break; case SH_DialogButtonBox_ButtonsHaveIcons: -#ifdef Q_WS_X11 - return true; -#endif ret = 0; + if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) + ret = theme->themeHint(QPlatformTheme::DialogButtonBoxButtonsHaveIcons).toBool() ? 1 : 0; break; case SH_SpellCheckUnderlineStyle: ret = QTextCharFormat::WaveUnderline; |