diff options
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qcursor.cpp | 6 | ||||
-rw-r--r-- | src/gui/kernel/qkeysequence.cpp | 10 | ||||
-rw-r--r-- | src/gui/kernel/qoffscreensurface.cpp | 1 | ||||
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 2 |
4 files changed, 8 insertions, 11 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/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/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() |