From da71c1c755b60a5f2544fd6708b97a8bc13f3679 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 9 Jan 2012 15:36:02 +0100 Subject: Introduce a QVariant themeHint() to QPlatformTheme. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Start on removing platform-specific code from QtWidgets. Change-Id: Ic2163a0ce6f2db2151cdf7ca93766b2d861eeb55 Reviewed-by: Samuel Rødal --- src/gui/kernel/qplatformtheme_qpa.cpp | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'src/gui/kernel/qplatformtheme_qpa.cpp') diff --git a/src/gui/kernel/qplatformtheme_qpa.cpp b/src/gui/kernel/qplatformtheme_qpa.cpp index b4a177f915..22d4452f4e 100644 --- a/src/gui/kernel/qplatformtheme_qpa.cpp +++ b/src/gui/kernel/qplatformtheme_qpa.cpp @@ -41,8 +41,36 @@ #include "qplatformtheme_qpa.h" +#include + QT_BEGIN_NAMESPACE +/*! + \class QPlatformTheme + \since 5.0 + \internal + \preliminary + \ingroup qpa + \brief The QPlatformTheme class allows customizing the UI based on themes. + +*/ + +/*! + \enum QPlatformTheme::ThemeHint + + This enum describes the available theme hints. + + \value TextCursorWidth (int) Determines the width of the text cursor. + + \value DropShadow (bool) Determines whether the drop shadow effect for + tooltips or whatsthis is enabled. + + \value MaximumScrollBarDragDistance (int) Determines the value returned by + QStyle::pixelMetric(PM_MaximumDragDistance) + + \sa themeHint(), QStyle::pixelMetric() +*/ + QPlatformMenu *QPlatformTheme::createPlatformMenu(QMenu *menu) const { Q_UNUSED(menu); @@ -67,4 +95,17 @@ QPlatformDialogHelper *QPlatformTheme::createPlatformDialogHelper(QDialog *dialo return 0; } +QVariant QPlatformTheme::themeHint(ThemeHint hint) const +{ + switch (hint) { + case TextCursorWidth: + return QVariant(1); + case DropShadow: + return QVariant(false); + case MaximumScrollBarDragDistance: + return QVariant(-1); + } + return QVariant(); +} + QT_END_NAMESPACE -- cgit v1.2.3