I think a lot depends on the content of the widget being grabbed, as if it has a layout, then the layout is (by default) executed when the widget is first shown. So either grab() would have to force the layout to be processed or you'd need to do it yourself for all this to work without the event loop.
As for the event loop itself, both QCoreApplication::exec() and QDialog::exec() are merely interfaces to QAbstractEventDispatcher which is a kind-of singleton (or actually a per-thread-instance) that does event processing. So to be precise, a dialog does not have its own event loop but rather its own event loop entry point (triggering the same event loop).





Reply With Quote

Bookmarks