From 8adad2fe09b173ff876895c27884f49804a20bcc Mon Sep 17 00:00:00 2001 From: Nick Shaforostoff Date: Wed, 13 Apr 2016 00:47:50 +0300 Subject: fix build with various QT_NO_* defines Done-with: Andriy Gerasika Change-Id: I90883a491dbddb005c3d756c339e42285d50e437 Reviewed-by: Oswald Buddenhagen Reviewed-by: Lars Knoll --- src/gui/kernel/qevent.cpp | 2 ++ src/gui/kernel/qplatformmenu.h | 2 ++ src/gui/kernel/qplatformtheme.cpp | 6 ++++++ src/gui/kernel/qplatformtheme.h | 2 ++ src/gui/kernel/qplatformtheme_p.h | 2 ++ src/gui/kernel/qwindowsysteminterface.cpp | 2 +- 6 files changed, 15 insertions(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 63876479bd..affc4c2526 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -3975,6 +3975,7 @@ QDebug operator<<(QDebug dbg, const QEvent *e) dbg << ')'; } break; +#ifndef QT_NO_SHORTCUT case QEvent::Shortcut: { const QShortcutEvent *se = static_cast(e); dbg << "QShortcutEvent(" << se->key().toString() << ", id=" << se->shortcutId(); @@ -3983,6 +3984,7 @@ QDebug operator<<(QDebug dbg, const QEvent *e) dbg << ')'; } break; +#endif case QEvent::FocusAboutToChange: case QEvent::FocusIn: case QEvent::FocusOut: diff --git a/src/gui/kernel/qplatformmenu.h b/src/gui/kernel/qplatformmenu.h index 6eaabd3e08..f08f0ef494 100644 --- a/src/gui/kernel/qplatformmenu.h +++ b/src/gui/kernel/qplatformmenu.h @@ -83,7 +83,9 @@ public: virtual void setRole(MenuRole role) = 0; virtual void setCheckable(bool checkable) = 0; virtual void setChecked(bool isChecked) = 0; +#ifndef QT_NO_SHORTCUT virtual void setShortcut(const QKeySequence& shortcut) = 0; +#endif virtual void setEnabled(bool enabled) = 0; virtual void setIconSize(int size) = 0; virtual void setNativeContents(WId item) { Q_UNUSED(item); } diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index d80ab8b597..9c140f1d68 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -153,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. @@ -336,6 +337,7 @@ const QKeyBinding QPlatformThemePrivate::keyBindings[] = { }; const uint QPlatformThemePrivate::numberOfKeyBindings = sizeof(QPlatformThemePrivate::keyBindings)/(sizeof(QKeyBinding)); +#endif QPlatformThemePrivate::QPlatformThemePrivate() : systemPalette(0) @@ -591,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; @@ -641,6 +644,7 @@ QList QPlatformTheme::keyBindings(QKeySequence::StandardKey key) c return list; } +#endif /*! Returns the text of a standard \a button. @@ -738,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; } diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h index a8baca1967..686dbed4b1 100644 --- a/src/gui/kernel/qplatformtheme.h +++ b/src/gui/kernel/qplatformtheme.h @@ -306,7 +306,9 @@ public: QPlatformTheme::IconOptions iconOptions = 0) const; virtual QIconEngine *createIconEngine(const QString &iconName) const; +#ifndef QT_NO_SHORTCUT virtual QList keyBindings(QKeySequence::StandardKey key) const; +#endif virtual QString standardButtonText(int button) const; diff --git a/src/gui/kernel/qplatformtheme_p.h b/src/gui/kernel/qplatformtheme_p.h index f2777c57b3..73deb890bb 100644 --- a/src/gui/kernel/qplatformtheme_p.h +++ b/src/gui/kernel/qplatformtheme_p.h @@ -67,8 +67,10 @@ public: void initializeSystemPalette(); +#ifndef QT_NO_SHORTCUT static const QKeyBinding keyBindings[]; static const uint numberOfKeyBindings; +#endif static unsigned currentKeyPlatforms(); diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index 73140b4f6f..7c6bbc26c8 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -236,7 +236,7 @@ bool QWindowSystemInterface::handleShortcutEvent(QWindow *window, ulong timestam #else Q_UNUSED(window) Q_UNUSED(timestamp) - Q_UNUSED(key) + Q_UNUSED(keyCode) Q_UNUSED(modifiers) Q_UNUSED(nativeScanCode) Q_UNUSED(nativeVirtualKey) -- cgit v1.2.3