Make GlobalShortcut::nativeEventFilter compatible with Qt 6
This commit is contained in:
@@ -54,7 +54,12 @@ bool GlobalShortcut::unregisterShortcut(quint32 native_key, quint32 native_mods)
|
||||
return UnregisterHotKey(0, native_mods ^ native_key);
|
||||
}
|
||||
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
bool GlobalShortcut::nativeEventFilter(const QByteArray &eventtype, void *message, qintptr *result) {
|
||||
#else
|
||||
bool GlobalShortcut::nativeEventFilter(const QByteArray &eventtype, void *message, long *result) {
|
||||
#endif
|
||||
|
||||
Q_UNUSED(eventtype);
|
||||
Q_UNUSED(result);
|
||||
|
||||
@@ -82,7 +82,11 @@ bool GlobalShortcut::unregisterShortcut(quint32 native_key, quint32 native_mods)
|
||||
return true;
|
||||
}
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
bool GlobalShortcut::nativeEventFilter(const QByteArray &eventtype, void *message, qintptr *result) {
|
||||
#else
|
||||
bool GlobalShortcut::nativeEventFilter(const QByteArray &eventtype, void *message, long *result) {
|
||||
#endif
|
||||
|
||||
Q_UNUSED(eventtype);
|
||||
Q_UNUSED(result);
|
||||
|
||||
@@ -61,7 +61,11 @@ class GlobalShortcut : public QObject, QAbstractNativeEventFilter {
|
||||
bool registerShortcut(quint32 native_key, quint32 native_mods);
|
||||
bool unregisterShortcut(quint32 native_key, quint32 native_mods);
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
bool nativeEventFilter(const QByteArray &eventtype, void *message, qintptr *result) override;
|
||||
#else
|
||||
bool nativeEventFilter(const QByteArray &eventtype, void *message, long *result) override;
|
||||
#endif
|
||||
|
||||
static GlobalShortcut *initialized_;
|
||||
static QHash<QPair<quint32, quint32>, GlobalShortcut*> internal_shortcuts_;
|
||||
|
||||
Reference in New Issue
Block a user