summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformtheme.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qplatformtheme.cpp')
-rw-r--r--src/gui/kernel/qplatformtheme.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp
index 7f74959a60..9c140f1d68 100644
--- a/src/gui/kernel/qplatformtheme.cpp
+++ b/src/gui/kernel/qplatformtheme.cpp
@@ -44,6 +44,7 @@
#include <QtCore/QVariant>
#include <QtCore/QStringList>
#include <QtCore/qfileinfo.h>
+#include <qicon.h>
#include <qpalette.h>
#include <qtextformat.h>
#include <private/qiconloader_p.h>
@@ -152,6 +153,7 @@ QT_BEGIN_NAMESPACE
*/
+#ifndef QT_NO_SHORTCUT
// Table of key bindings. It must be sorted on key sequence:
// The integer value of VK_KEY | Modifier Keys (e.g., VK_META, and etc.)
// A priority of 1 indicates that this is the primary key binding when multiple are defined.
@@ -335,6 +337,7 @@ const QKeyBinding QPlatformThemePrivate::keyBindings[] = {
};
const uint QPlatformThemePrivate::numberOfKeyBindings = sizeof(QPlatformThemePrivate::keyBindings)/(sizeof(QKeyBinding));
+#endif
QPlatformThemePrivate::QPlatformThemePrivate()
: systemPalette(0)
@@ -405,14 +408,22 @@ QPixmap QPlatformTheme::standardPixmap(StandardPixmap sp, const QSizeF &size) co
return QPixmap();
}
-QPixmap QPlatformTheme::fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size,
- QPlatformTheme::IconOptions iconOptions) const
+/*!
+ \brief Return an icon for \a fileInfo, observing \a iconOptions.
+
+ This function is queried by QFileIconProvider and similar classes to obtain
+ an icon for a file. If it does not return a non-null icon, fileIconPixmap()
+ is queried for a specific size.
+
+ \since 5.8
+*/
+
+QIcon QPlatformTheme::fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions) const
{
Q_UNUSED(fileInfo);
- Q_UNUSED(size);
Q_UNUSED(iconOptions);
// TODO Should return QCommonStyle pixmaps?
- return QPixmap();
+ return QIcon();
}
QVariant QPlatformTheme::themeHint(ThemeHint hint) const
@@ -444,6 +455,8 @@ QVariant QPlatformTheme::themeHint(ThemeHint hint) const
return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::MousePressAndHoldInterval);
case QPlatformTheme::ItemViewActivateItemOnSingleClick:
return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::ItemViewActivateItemOnSingleClick);
+ case QPlatformTheme::UiEffects:
+ return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::UiEffects);
default:
return QPlatformTheme::defaultThemeHint(hint);
}
@@ -580,6 +593,7 @@ static inline int maybeSwapShortcut(int shortcut)
}
#endif
+#ifndef QT_NO_SHORTCUT
// mixed-mode predicate: all of these overloads are actually needed (but not all for every compiler)
struct ByStandardKey {
typedef bool result_type;
@@ -630,6 +644,7 @@ QList<QKeySequence> QPlatformTheme::keyBindings(QKeySequence::StandardKey key) c
return list;
}
+#endif
/*!
Returns the text of a standard \a button.
@@ -727,10 +742,12 @@ unsigned QPlatformThemePrivate::currentKeyPlatforms()
{
const uint keyboardScheme = QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::KeyboardScheme).toInt();
unsigned result = 1u << keyboardScheme;
+#ifndef QT_NO_SHORTCUT
if (keyboardScheme == QPlatformTheme::KdeKeyboardScheme
|| keyboardScheme == QPlatformTheme::GnomeKeyboardScheme
|| keyboardScheme == QPlatformTheme::CdeKeyboardScheme)
result |= KB_X11;
+#endif
return result;
}