Annoying White Screen Flash Before Webkit App Loads
Solved
General and Desktop
-
I've built a Qt 5.5 widget-based application with the QWebView widget. However, unfortunately when the application loads (even when compiled and run through macdeployqt), it flashes a brief white screen for half a second before it displays the content.
Is there anything I can do to never display the window until the HTML has finished rendering the first time?
-
I fixed it like so:
- Comment out the default
w.show()
in my main.cpp. - I created a Q_INVOKABLE class method on main window called
showAppWindow()
that merely does athis->show()
. - I did the steps to inject my C++ object (called
cpp
) into my Javascript via the C++ <==> Webkit bridge. - In my index.html file, at the bottom before the ending BODY tag, I added this:
<script type="text/javascript"> try { if (cpp) { setTimeout('cpp.showAppWindow();',100); } } catch(e){} </script>
- Comment out the default