diff --git a/src/kernel/qapplication.cpp b/src/kernel/qapplication.cpp index aa2806e..d87d2e5 100644 --- a/src/kernel/qapplication.cpp +++ b/src/kernel/qapplication.cpp @@ -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()) { diff --git a/src/kernel/qapplication.h b/src/kernel/qapplication.h index de65e39..dca2138 100644 --- a/src/kernel/qapplication.h +++ b/src/kernel/qapplication.h @@ -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,