summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-11-25 02:20:50 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-11-25 02:20:50 -0600
commit56999a270de5c243399b7f237007b87559668c6f (patch)
tree47a01e67f31e21a7b0144f1ff961f0960f9ab3d9
parentc0780a876e11732962b98e3b1aac0f503b4e9ad9 (diff)
downloadqt3-56999a270de5c243399b7f237007b87559668c6f.tar.gz
qt3-56999a270de5c243399b7f237007b87559668c6f.zip
Wake up the correct event loop when an event is posted to TQApplication
This relates to Bug 1703
-rw-r--r--src/kernel/qapplication.cpp29
-rw-r--r--src/kernel/qapplication.h6
2 files changed, 20 insertions, 15 deletions
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,