diff options
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 19 | ||||
-rw-r--r-- | src/gui/kernel/qkeysequence.cpp | 17 | ||||
-rw-r--r-- | src/gui/kernel/qkeysequence_p.h | 4 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.cpp | 6 |
4 files changed, 37 insertions, 9 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 58e2586024..f98b4236fe 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -960,15 +960,10 @@ QList<QScreen *> QGuiApplication::screens() /*! \property QGuiApplication::primaryScreen - \brief the primary (or default) screen of the application, or null if there is none. + \brief the primary (or default) screen of the application. This will be the screen where QWindows are initially shown, unless otherwise specified. - On some platforms, it may be null when there are actually no screens connected. - It is not possible to start a new QGuiApplication while there are no screens. - Applications which were running at the time the primary screen was removed - will stop rendering graphics until one or more screens are restored. - The primaryScreenChanged signal was introduced in Qt 5.6. \sa screens() @@ -1095,7 +1090,7 @@ static void init_platform(const QString &pluginArgument, const QString &platform QStringList keys = QPlatformIntegrationFactory::keys(platformPluginPath); QString fatalMessage - = QStringLiteral("This application failed to start because it could not find or load the Qt platform plugin \"%1\".\n\n").arg(name); + = QStringLiteral("This application failed to start because it could not find or load the Qt platform plugin \"%1\"\nin \"%2\".\n\n").arg(name, QDir::toNativeSeparators(platformPluginPath)); if (!keys.isEmpty()) { fatalMessage += QStringLiteral("Available platform plugins are: %1.\n\n").arg( keys.join(QStringLiteral(", "))); @@ -1999,6 +1994,16 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE window = QGuiApplication::focusWindow(); } +#if !defined(Q_OS_OSX) + // FIXME: Include OS X in this code path by passing the key event through + // QPlatformInputContext::filterEvent(). + if (e->keyType == QEvent::KeyPress && window) { + if (QWindowSystemInterface::handleShortcutEvent(window, e->timestamp, e->key, e->modifiers, + e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers, e->unicode, e->repeat, e->repeatCount)) + return; + } +#endif + QKeyEvent ev(e->keyType, e->key, e->modifiers, e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers, e->unicode, e->repeat, e->repeatCount); diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index 9fe7267607..38cc9506ee 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -146,6 +146,23 @@ static int qtkeyForMacSymbol(const QChar ch) #else static bool qt_sequence_no_mnemonics = false; #endif + +/*! + \fn void qt_set_sequence_auto_mnemonic(bool b) + \relates QKeySequence + + Specifies whether mnemonics for menu items, labels, etc., should + be honored or not. On Windows and X11, this feature is + on by default; on OS X, it is off. When this feature is off + (that is, when \a b is false), QKeySequence::mnemonic() always + returns an empty string. + + \note This function is not declared in any of Qt's header files. + To use it in your application, declare the function prototype + before calling it. + + \sa QShortcut +*/ void Q_GUI_EXPORT qt_set_sequence_auto_mnemonic(bool b) { qt_sequence_no_mnemonics = !b; } /*! diff --git a/src/gui/kernel/qkeysequence_p.h b/src/gui/kernel/qkeysequence_p.h index abe91df2ee..492546616b 100644 --- a/src/gui/kernel/qkeysequence_p.h +++ b/src/gui/kernel/qkeysequence_p.h @@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE #ifndef QT_NO_SHORTCUT -struct Q_AUTOTEST_EXPORT QKeyBinding +struct QKeyBinding { QKeySequence::StandardKey standardKey; uchar priority; @@ -66,7 +66,7 @@ struct Q_AUTOTEST_EXPORT QKeyBinding uint platform; }; -class Q_AUTOTEST_EXPORT QKeySequencePrivate +class QKeySequencePrivate { public: enum { MaxKeyCount = 4 }; // also used in QKeySequenceEdit diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index 7055b7947a..d17c9c08a8 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -255,8 +255,10 @@ bool QWindowSystemInterface::handleKeyEvent(QWindow *w, QEvent::Type t, int k, Q bool QWindowSystemInterface::handleKeyEvent(QWindow *tlw, ulong timestamp, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text, bool autorep, ushort count) { +#if defined(Q_OS_OSX) if (t == QEvent::KeyPress && QWindowSystemInterface::handleShortcutEvent(tlw, timestamp, k, mods, 0, 0, 0, text, autorep, count)) return true; +#endif QWindowSystemInterfacePrivate::KeyEvent * e = new QWindowSystemInterfacePrivate::KeyEvent(tlw, timestamp, t, k, mods, text, autorep, count); @@ -281,10 +283,14 @@ bool QWindowSystemInterface::handleExtendedKeyEvent(QWindow *tlw, ulong timestam const QString& text, bool autorep, ushort count, bool tryShortcutOverride) { +#if defined(Q_OS_OSX) if (tryShortcutOverride && type == QEvent::KeyPress && QWindowSystemInterface::handleShortcutEvent(tlw, timestamp, key, modifiers, nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorep, count)) { return true; } +#else + Q_UNUSED(tryShortcutOverride) +#endif QWindowSystemInterfacePrivate::KeyEvent * e = new QWindowSystemInterfacePrivate::KeyEvent(tlw, timestamp, type, key, modifiers, |