QxtGlobalShortcutPrivate::~QxtGlobalShortcutPrivate() { #ifndef Q_OS_MACOS --ref; if (ref == 0) { QAbstractEventDispatcher *ed = QAbstractEventDispatcher::instance(); if (ed != nullptr) { ed->removeNativeEventFilter(this); } } #endif // Q_OS_MACOS }
QxtGlobalShortcutPrivate::~QxtGlobalShortcutPrivate() { #ifndef Q_WS_MAC --ref; if (ref == 0) { QAbstractEventDispatcher *ed = QAbstractEventDispatcher::instance(); if (ed != 0) { # if QT_VERSION < QT_VERSION_CHECK(5,0,0) ed->setEventFilter(prevEventFilter); # else ed->removeNativeEventFilter(this); # endif } } #endif // Q_WS_MAC }
/*! Destroys the native event filter. This automatically removes it from the application. */ QAbstractNativeEventFilter::~QAbstractNativeEventFilter() { QAbstractEventDispatcher *eventDispatcher = QAbstractEventDispatcher::instance(); if (eventDispatcher) eventDispatcher->removeNativeEventFilter(this); }