diff options
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qkeysequence.h | 4 | ||||
-rw-r--r-- | src/gui/kernel/qplatformdialoghelper.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qplatformdialoghelper.h | 21 | ||||
-rw-r--r-- | src/gui/kernel/qplatformservices.cpp | 5 | ||||
-rw-r--r-- | src/gui/kernel/qplatformtheme.cpp | 4 | ||||
-rw-r--r-- | src/gui/kernel/qplatformtheme.h | 8 | ||||
-rw-r--r-- | src/gui/kernel/qshortcutmap.cpp | 3 |
7 files changed, 36 insertions, 11 deletions
diff --git a/src/gui/kernel/qkeysequence.h b/src/gui/kernel/qkeysequence.h index 05460c6651..8a989682d8 100644 --- a/src/gui/kernel/qkeysequence.h +++ b/src/gui/kernel/qkeysequence.h @@ -44,6 +44,7 @@ #include <QtCore/qnamespace.h> #include <QtCore/qstring.h> +#include <QtCore/qobjectdefs.h> QT_BEGIN_NAMESPACE @@ -68,6 +69,9 @@ class QKeySequencePrivate; class Q_GUI_EXPORT QKeySequence { + Q_GADGET + Q_ENUMS(StandardKey) + public: enum StandardKey { UnknownKey, diff --git a/src/gui/kernel/qplatformdialoghelper.cpp b/src/gui/kernel/qplatformdialoghelper.cpp index 5f86b511f7..0ee8e8b4aa 100644 --- a/src/gui/kernel/qplatformdialoghelper.cpp +++ b/src/gui/kernel/qplatformdialoghelper.cpp @@ -495,6 +495,8 @@ QStringList QFileDialogOptions::nameFilters() const void QFileDialogOptions::setDefaultSuffix(const QString &suffix) { d->defaultSuffix = suffix; + if (d->defaultSuffix.size() > 1 && d->defaultSuffix.startsWith(QLatin1Char('.'))) + d->defaultSuffix.remove(0, 1); // Silently change ".txt" -> "txt". } QString QFileDialogOptions::defaultSuffix() const diff --git a/src/gui/kernel/qplatformdialoghelper.h b/src/gui/kernel/qplatformdialoghelper.h index ecc00ed8c6..7412bdbec3 100644 --- a/src/gui/kernel/qplatformdialoghelper.h +++ b/src/gui/kernel/qplatformdialoghelper.h @@ -163,7 +163,11 @@ class Q_GUI_EXPORT QFontDialogOptions public: enum FontDialogOption { NoButtons = 0x00000001, - DontUseNativeDialog = 0x00000002 + DontUseNativeDialog = 0x00000002, + ScalableFonts = 0x00000004, + NonScalableFonts = 0x00000008, + MonospacedFonts = 0x00000010, + ProportionalFonts = 0x00000020 }; Q_DECLARE_FLAGS(FontDialogOptions, FontDialogOption) @@ -217,13 +221,14 @@ public: enum FileDialogOption { - ShowDirsOnly = 0x00000001, - DontResolveSymlinks = 0x00000002, - DontConfirmOverwrite = 0x00000004, - DontUseSheet = 0x00000008, - DontUseNativeDialog = 0x00000010, - ReadOnly = 0x00000020, - HideNameFilterDetails = 0x00000040 + ShowDirsOnly = 0x00000001, + DontResolveSymlinks = 0x00000002, + DontConfirmOverwrite = 0x00000004, + DontUseSheet = 0x00000008, + DontUseNativeDialog = 0x00000010, + ReadOnly = 0x00000020, + HideNameFilterDetails = 0x00000040, + DontUseCustomDirectoryIcons = 0x00000080 }; Q_DECLARE_FLAGS(FileDialogOptions, FileDialogOption) diff --git a/src/gui/kernel/qplatformservices.cpp b/src/gui/kernel/qplatformservices.cpp index f2cade0a35..d09b74c6fe 100644 --- a/src/gui/kernel/qplatformservices.cpp +++ b/src/gui/kernel/qplatformservices.cpp @@ -74,7 +74,10 @@ bool QPlatformServices::openDocument(const QUrl &url) /*! * \brief QPlatformServices::desktopEnvironment returns the active desktop environment. * - * On Unix this function returns KDE, GNOME or UNKNOWN. + * On Unix this function returns the uppercase desktop environment name, such as + * KDE, GNOME, UNITY, XFCE, LXDE etc. or UNKNOWN if none was detected. + * The primary way to detect the desktop environment is the environment variable + * XDG_CURRENT_DESKTOP. */ QByteArray QPlatformServices::desktopEnvironment() const { diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index 02b69bcb4d..098b8dad66 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -208,10 +208,12 @@ QPixmap QPlatformTheme::standardPixmap(StandardPixmap sp, const QSizeF &size) co return QPixmap(); } -QPixmap QPlatformTheme::fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size) const +QPixmap QPlatformTheme::fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size, + QPlatformTheme::IconOptions iconOptions) const { Q_UNUSED(fileInfo); Q_UNUSED(size); + Q_UNUSED(iconOptions); // TODO Should return QCommonStyle pixmaps? return QPixmap(); } diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h index 80ba29a028..f974f18908 100644 --- a/src/gui/kernel/qplatformtheme.h +++ b/src/gui/kernel/qplatformtheme.h @@ -253,6 +253,11 @@ public: AnimateToolBoxUiEffect = 0x40 }; + enum IconOption { + DontUseCustomDirectoryIcons = 0x01 + }; + Q_DECLARE_FLAGS(IconOptions, IconOption) + explicit QPlatformTheme(); virtual ~QPlatformTheme(); @@ -274,7 +279,8 @@ public: virtual QVariant themeHint(ThemeHint hint) const; virtual QPixmap standardPixmap(StandardPixmap sp, const QSizeF &size) const; - virtual QPixmap fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size) const; + virtual QPixmap fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size, + QPlatformTheme::IconOptions iconOptions = 0) const; virtual QIconEngine *createIconEngine(const QString &iconName) const; diff --git a/src/gui/kernel/qshortcutmap.cpp b/src/gui/kernel/qshortcutmap.cpp index cd822090e2..513e21937e 100644 --- a/src/gui/kernel/qshortcutmap.cpp +++ b/src/gui/kernel/qshortcutmap.cpp @@ -324,6 +324,9 @@ bool QShortcutMap::tryShortcutEvent(QObject *o, QKeyEvent *e) { Q_D(QShortcutMap); + if (e->key() == Qt::Key_unknown) + return false; + bool wasAccepted = e->isAccepted(); bool wasSpontaneous = e->spont; if (d->currentState == QKeySequence::NoMatch) { |