summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qcursor.cpp6
-rw-r--r--src/gui/kernel/qevent.cpp2
-rw-r--r--src/gui/kernel/qkeysequence.cpp10
-rw-r--r--src/gui/kernel/qoffscreensurface.cpp1
-rw-r--r--src/gui/kernel/qplatformmenu.h2
-rw-r--r--src/gui/kernel/qplatformtheme.cpp6
-rw-r--r--src/gui/kernel/qplatformtheme.h2
-rw-r--r--src/gui/kernel/qplatformtheme_p.h2
-rw-r--r--src/gui/kernel/qsurfaceformat.h6
-rw-r--r--src/gui/kernel/qwindow.cpp2
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp2
11 files changed, 29 insertions, 12 deletions
diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp
index dad6a1f382..b7035d47c4 100644
--- a/src/gui/kernel/qcursor.cpp
+++ b/src/gui/kernel/qcursor.cpp
@@ -374,9 +374,6 @@ QDataStream &operator>>(QDataStream &s, QCursor &c)
because this size is supported on all platforms. Some platforms
also support 16 x 16, 48 x 48, and 64 x 64 cursors.
- \note On Windows CE, the cursor size is fixed. If the pixmap
- is bigger than the system size, it will be scaled.
-
\sa QPixmap::QPixmap(), QPixmap::setMask()
*/
@@ -433,9 +430,6 @@ QCursor::QCursor(const QPixmap &pixmap, int hotX, int hotY)
because this size is supported on all platforms. Some platforms
also support 16 x 16, 48 x 48, and 64 x 64 cursors.
- \note On Windows CE, the cursor size is fixed. If the pixmap
- is bigger than the system size, it will be scaled.
-
\sa QBitmap::QBitmap(), QBitmap::setMask()
*/
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<const QShortcutEvent *>(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/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index f1135db307..9a75f4bc83 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -411,7 +411,7 @@ void Q_GUI_EXPORT qt_set_sequence_auto_mnemonic(bool b) { qt_sequence_no_mnemoni
static const struct {
int key;
- const char* name;
+ const char name[25];
} keyname[] = {
//: This and all following "incomprehensible" strings in QShortcut context
//: are key names. Please use the localized names appearing on actual
@@ -693,8 +693,8 @@ static const struct {
{ Qt::Key_TouchpadOn, QT_TRANSLATE_NOOP("QShortcut", "Touchpad On") },
{ Qt::Key_TouchpadOff, QT_TRANSLATE_NOOP("QShortcut", "Touchpad Off") },
- { 0, 0 }
};
+static Q_CONSTEXPR int numKeyNames = sizeof keyname / sizeof *keyname;
/*!
\enum QKeySequence::StandardKey
@@ -1179,7 +1179,7 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence
for (int tran = 0; tran < 2; ++tran) {
if (!nativeText)
++tran;
- for (int i = 0; keyname[i].name; ++i) {
+ for (int i = 0; i < numKeyNames; ++i) {
QString keyName(tran == 0
? QCoreApplication::translate("QShortcut", keyname[i].name)
: QString::fromLatin1(keyname[i].name));
@@ -1318,7 +1318,7 @@ QString QKeySequencePrivate::keyName(int key, QKeySequence::SequenceFormat forma
#if defined(Q_OS_MACX)
NonSymbol:
#endif
- while (keyname[i].name) {
+ while (i < numKeyNames) {
if (key == keyname[i].key) {
p = nativeText ? QCoreApplication::translate("QShortcut", keyname[i].name)
: QString::fromLatin1(keyname[i].name);
@@ -1330,7 +1330,7 @@ NonSymbol:
// fall back on the unicode representation of it...
// Or else characters like Qt::Key_aring may not get displayed
// (Really depends on you locale)
- if (!keyname[i].name) {
+ if (i >= numKeyNames) {
if (!QChar::requiresSurrogates(key)) {
p = QChar(ushort(key)).toUpper();
} else {
diff --git a/src/gui/kernel/qoffscreensurface.cpp b/src/gui/kernel/qoffscreensurface.cpp
index d18847c434..a9535a6ad7 100644
--- a/src/gui/kernel/qoffscreensurface.cpp
+++ b/src/gui/kernel/qoffscreensurface.cpp
@@ -183,6 +183,7 @@ void QOffscreenSurface::create()
if (QThread::currentThread() != qGuiApp->thread())
qWarning("Attempting to create QWindow-based QOffscreenSurface outside the gui thread. Expect failures.");
d->offscreenWindow = new QWindow(d->screen);
+ d->offscreenWindow->setObjectName(QLatin1String("QOffscreenSurface"));
// Remove this window from the global list since we do not want it to be destroyed when closing the app.
// The QOffscreenSurface has to be usable even after exiting the event loop.
QGuiApplicationPrivate::window_list.removeOne(d->offscreenWindow);
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<QKeySequence> 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<QKeySequence> 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/qsurfaceformat.h b/src/gui/kernel/qsurfaceformat.h
index b4e3f68b97..246163609e 100644
--- a/src/gui/kernel/qsurfaceformat.h
+++ b/src/gui/kernel/qsurfaceformat.h
@@ -41,6 +41,7 @@
#include <QtGui/qtguiglobal.h>
#include <QtCore/qpair.h>
+#include <QtCore/qobjectdefs.h>
QT_BEGIN_NAMESPACE
@@ -50,6 +51,7 @@ class QSurfaceFormatPrivate;
class Q_GUI_EXPORT QSurfaceFormat
{
+ Q_GADGET
public:
enum FormatOption {
StereoBuffers = 0x0001,
@@ -57,6 +59,7 @@ public:
DeprecatedFunctions = 0x0004,
ResetNotification = 0x0008
};
+ Q_ENUM(FormatOption)
Q_DECLARE_FLAGS(FormatOptions, FormatOption)
enum SwapBehavior {
@@ -65,6 +68,7 @@ public:
DoubleBuffer,
TripleBuffer
};
+ Q_ENUM(SwapBehavior)
enum RenderableType {
DefaultRenderableType = 0x0,
@@ -72,12 +76,14 @@ public:
OpenGLES = 0x2,
OpenVG = 0x4
};
+ Q_ENUM(RenderableType)
enum OpenGLContextProfile {
NoProfile,
CoreProfile,
CompatibilityProfile
};
+ Q_ENUM(OpenGLContextProfile)
QSurfaceFormat();
/*implicit*/ QSurfaceFormat(FormatOptions options);
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index f061a2bf50..5f71bdaded 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -210,6 +210,8 @@ QWindow::~QWindow()
{
destroy();
QGuiApplicationPrivate::window_list.removeAll(this);
+ if (!QGuiApplicationPrivate::is_app_closing)
+ QGuiApplicationPrivate::instance()->modalWindowList.removeOne(this);
}
void QWindowPrivate::init()
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)