The authorization dialog that grants the application access to the
assets will only show after returning back from
applicationDidFinishLaunching. Therefore, trying to load an asset from
main before qApp->exec() would normally fail. To remedy that, we added
a path that starts a QEventLoop for a split second to force the
application init process to finish. But this can only work if we
start it from the main thread.
A bug with this is seen in QML FileDialog, since it (clumsy enough)
starts to iterate, in a separate thread, all the files in its currently
set directory upon start-up construction (which should be fixed as
well). The result is that the application gets dead-locked on start-up.
Change-Id: I0047272d53314752903960b33f88b33dc0d7e78d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>