Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
4.6.0
-
None
-
Mac OS X 10.5
-
-
ec452c7f31ffe53dc28763a80d517288ac3c118d
Description
So my application has its own event loop and I just integrate Qt into my event loop. This has been working fine for a while but just broke in 4.6. None of my menus show until I get a popup menu to show first. If I create a dummy event loop and have a single shot timer quit it the menus show fine. I see the same behavior with Cocoa and Carbon builds. I modified the examples/mainwindows/menus example to illustrate my point. The only file I modified was main.cpp.
#include <QApplication> #include <QAbstractEventDispatcher> #include <QTimer> #include "mainwindow.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); MainWindow window; window.show(); // If you uncomment the next three lines everything works as expected // QEventLoop dummyLoop; // QTimer::singleShot(0, &dummyLoop, SLOT (quit ())); // dummyLoop.exec (); QAbstractEventDispatcher *ed = QAbstractEventDispatcher::instance (); do { QCoreApplication::sendPostedEvents (0, 0); QCoreApplication::processEvents (); } while (window.isVisible ()); // return app.exec(); return 0; }
There seems to be some sort of event that is not getting sent unless a QEventLoop::exec is called. If this is not a bug can you please let me know what I can do to get my code to work without having to ever call exec? Thanks.