From 2b50e205780f007dd5c2955cd7d492d3f5f909b1 Mon Sep 17 00:00:00 2001 From: Xizhi Zhu Date: Sun, 19 Feb 2012 10:15:18 +0100 Subject: Merges several overloaded functions in QCoreApplication. The source compatibility is kept. Change-Id: If66053b271d65062b3c0ce6ec66c8394a37b4e3e Reviewed-by: Lars Knoll Reviewed-by: Thiago Macieira --- src/corelib/kernel/qcoreapplication.cpp | 58 ++------------------------------- 1 file changed, 3 insertions(+), 55 deletions(-) (limited to 'src/corelib/kernel/qcoreapplication.cpp') diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 80e42336d6..2d49b271ce 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -1011,35 +1011,6 @@ void QCoreApplication::exit(int returnCode) */ /*! - Adds the event \a event, with the object \a receiver as the - receiver of the event, to an event queue and returns immediately. - - The event must be allocated on the heap since the post event queue - will take ownership of the event and delete it once it has been - posted. It is \e {not safe} to access the event after - it has been posted. - - When control returns to the main event loop, all events that are - stored in the queue will be sent using the notify() function. - - Events are processed in the order posted. For more control over - the processing order, use the postEvent() overload below, which - takes a priority argument. This function posts all event with a - Qt::NormalEventPriority. - - \threadsafe - - \sa sendEvent(), notify(), sendPostedEvents() -*/ - -void QCoreApplication::postEvent(QObject *receiver, QEvent *event) -{ - postEvent(receiver, event, Qt::NormalEventPriority); -} - - -/*! - \overload postEvent() \since 4.3 Adds the event \a event, with the object \a receiver as the @@ -1166,13 +1137,6 @@ bool QCoreApplication::compressEvent(QEvent *event, QObject *receiver, QPostEven return false; } -/*! - \fn void QCoreApplication::sendPostedEvents() - \overload sendPostedEvents() - - Dispatches all posted events, i.e. empties the event queue. -*/ - /*! Immediately dispatches all events which have been previously queued with QCoreApplication::postEvent() and which are for the object \a receiver @@ -1188,7 +1152,6 @@ bool QCoreApplication::compressEvent(QEvent *event, QObject *receiver, QPostEven \sa flush(), postEvent() */ - void QCoreApplication::sendPostedEvents(QObject *receiver, int event_type) { QThreadData *data = QThreadData::current(); @@ -1343,23 +1306,6 @@ void QCoreApplicationPrivate::sendPostedEvents(QObject *receiver, int event_type } /*! - Removes all events posted using postEvent() for \a receiver. - - The events are \e not dispatched, instead they are removed from the - queue. You should never need to call this function. If you do call it, - be aware that killing events may cause \a receiver to break one or - more invariants. - - \threadsafe -*/ - -void QCoreApplication::removePostedEvents(QObject *receiver) -{ - removePostedEvents(receiver, 0); -} - -/*! - \overload removePostedEvents() \since 4.3 Removes all events of the given \a eventType that were posted @@ -1372,7 +1318,9 @@ void QCoreApplication::removePostedEvents(QObject *receiver) If \a receiver is null, the events of \a eventType are removed for all objects. If \a eventType is 0, all the events are removed for - \a receiver. + \a receiver. You should never call this function with \a eventType + of 0. If you do call it in this way, be aware that killing events + may cause \a receiver to break one or more invariants. \threadsafe */ -- cgit v1.2.3