diff options
-rw-r--r-- | src/corelib/kernel/qabstracteventdispatcher.cpp | 6 | ||||
-rw-r--r-- | src/corelib/kernel/qabstracteventdispatcher.h | 2 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 6 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreapplication.h | 4 |
4 files changed, 14 insertions, 4 deletions
diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp index 54524fa55b..90e3a1e9e1 100644 --- a/src/corelib/kernel/qabstracteventdispatcher.cpp +++ b/src/corelib/kernel/qabstracteventdispatcher.cpp @@ -210,9 +210,11 @@ QAbstractEventDispatcher *QAbstractEventDispatcher::instance(QThread *thread) */ /*! \fn bool QAbstractEventDispatcher::hasPendingEvents() + \deprecated - Returns \c true if there is an event waiting; otherwise returns - false. + Returns \c true if there is an event waiting; otherwise returns false. This + function is an implementation detail for + QCoreApplication::hasPendingEvents() and must not be called directly. */ /*! diff --git a/src/corelib/kernel/qabstracteventdispatcher.h b/src/corelib/kernel/qabstracteventdispatcher.h index 6f21cefa4e..d95ebe0ca2 100644 --- a/src/corelib/kernel/qabstracteventdispatcher.h +++ b/src/corelib/kernel/qabstracteventdispatcher.h @@ -78,7 +78,7 @@ public: static QAbstractEventDispatcher *instance(QThread *thread = 0); virtual bool processEvents(QEventLoop::ProcessEventsFlags flags) = 0; - virtual bool hasPendingEvents() = 0; + virtual bool hasPendingEvents() = 0; // ### Qt6: remove, mark final or make protected virtual void registerSocketNotifier(QSocketNotifier *notifier) = 0; virtual void unregisterSocketNotifier(QSocketNotifier *notifier) = 0; diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index f6d4a3b10b..e8bcc449e9 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -2558,10 +2558,16 @@ void QCoreApplication::removeNativeEventFilter(QAbstractNativeEventFilter *filte } /*! + \deprecated + This function returns \c true if there are pending events; otherwise returns \c false. Pending events can be either from the window system or posted events using postEvent(). + \note this function is not thread-safe. It may only be called in the main + thread and only if there are no other threads running in the application + (including threads Qt starts for its own purposes). + \sa QAbstractEventDispatcher::hasPendingEvents() */ bool QCoreApplication::hasPendingEvents() diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h index c2843030fd..d8c52fbf1d 100644 --- a/src/corelib/kernel/qcoreapplication.h +++ b/src/corelib/kernel/qcoreapplication.h @@ -127,7 +127,9 @@ public: static void postEvent(QObject *receiver, QEvent *event, int priority = Qt::NormalEventPriority); static void sendPostedEvents(QObject *receiver = 0, int event_type = 0); static void removePostedEvents(QObject *receiver, int eventType = 0); - static bool hasPendingEvents(); +#if QT_DEPRECATED_SINCE(5, 3) + QT_DEPRECATED static bool hasPendingEvents(); +#endif static QAbstractEventDispatcher *eventDispatcher(); static void setEventDispatcher(QAbstractEventDispatcher *eventDispatcher); |