diff options
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qplatformtheme_qpa.cpp | 41 | ||||
-rw-r--r-- | src/gui/kernel/qplatformtheme_qpa.h | 9 |
2 files changed, 50 insertions, 0 deletions
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 <QtCore/QVariant> + 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 diff --git a/src/gui/kernel/qplatformtheme_qpa.h b/src/gui/kernel/qplatformtheme_qpa.h index 06a81fda4a..c3e5b677a2 100644 --- a/src/gui/kernel/qplatformtheme_qpa.h +++ b/src/gui/kernel/qplatformtheme_qpa.h @@ -56,15 +56,24 @@ class QPlatformMenu; class QPlatformMenuBar; class QPlatformDialogHelper; class QDialog; +class QVariant; class Q_GUI_EXPORT QPlatformTheme { public: + enum ThemeHint { + TextCursorWidth, + DropShadow, + MaximumScrollBarDragDistance + }; + virtual QPlatformMenu *createPlatformMenu(QMenu *menu = 0) const; virtual QPlatformMenuBar *createPlatformMenuBar(QMenuBar *menuBar = 0) const; virtual bool usePlatformNativeDialog(const QDialog *dialog = 0) const; virtual QPlatformDialogHelper *createPlatformDialogHelper(QDialog *dialog = 0) const; + + virtual QVariant themeHint(ThemeHint hint) const; }; QT_END_NAMESPACE |