Wake up the correct event loop when an event is posted to TQApplication

This relates to Bug 1703
pull/2/head
Timothy Pearson 11 years ago
parent c0780a876e
commit 56999a270d

@ -2453,6 +2453,16 @@ void QApplication::aboutQt()
\sa postEvent(), notify()
*/
bool QApplication::sendEvent( QObject *receiver, QEvent *event ) {
if ( event ) event->spont = FALSE;
return qApp ? qApp->notify( receiver, event ) : FALSE;
}
bool QApplication::sendSpontaneousEvent( QObject *receiver, QEvent *event ) {
if ( event ) event->spont = TRUE;
return qApp ? qApp->notify( receiver, event ) : FALSE;
}
/*!
Sends event \a e to \a receiver: \a {receiver}->event(\a e).
Returns the value that is returned from the receiver's event handler.
@ -3452,18 +3462,19 @@ void QApplication::postEvent( QObject *receiver, QEvent *event )
globalPostedEvents->append( pe );
#ifdef QT_THREAD_SUPPORT
if ( event->type() == QEvent::MetaCall ) {
// Wake up the receiver thread event loop
QThread* thread = receiver->contextThreadObject();
if (thread) {
if (thread->d) {
if (thread->d->eventLoop) {
thread->d->eventLoop->wakeUp();
}
// Wake up the receiver thread event loop
QThread* thread = receiver->contextThreadObject();
if (thread) {
if (thread->d) {
if (thread->d->eventLoop) {
thread->d->eventLoop->wakeUp();
return;
}
}
}
if ( event->type() == QEvent::MetaCall ) {
return;
}
}
#endif
if (currentEventLoop()) {

@ -539,12 +539,6 @@ inline QSize QApplication::globalStrut()
return app_strut;
}
inline bool QApplication::sendEvent( QObject *receiver, QEvent *event )
{ if ( event ) event->spont = FALSE; return qApp ? qApp->notify( receiver, event ) : FALSE; }
inline bool QApplication::sendSpontaneousEvent( QObject *receiver, QEvent *event )
{ if ( event ) event->spont = TRUE; return qApp ? qApp->notify( receiver, event ) : FALSE; }
#ifdef QT_NO_TRANSLATION
// Simple versions
inline QString QApplication::translate( const char *, const char *sourceText,

Loading…
Cancel
Save