The openGL display stays black under iOS
-
Hello,
I'm trying to transpose to iOs a qt + opengl application that runs without any problem on Windows, Linux, Android and macOS.
The opengl display remains black in the simulator even if the Qml boxes display correctly.
There is no error in the logs and there are no Opengl errors.
I added
<Key>PrefersOpenGL>/key>
<True/>in the plist of the application but it doesn't change anything.
Does anyone have any ideas?
Thank you!
PS: I'm using Qt 5.15.0 with ios 13.2
-
Hi,
Did you try to build the same application with an older version of Qt like 5.14.2 ?
-
I just tried with Qt 5.14.02 and 5.13.2 but it doesn't work unfortunately...
-
Can you create a minimal compilable example that shows that behavior ?
-
Hi SGaist !
I just found what's happening.
In fact, it's the splah screen that I create from the QSplashScreen class that stays black and in the first plan, even after destroying it!
The opengl display is not in question at all ...There is something to know about using the QSplashScreen class under iOs?
I know that Apple offers UILaunchImage to do this but you can't display text on the image! -
Good catch !
Widgets are working on mobile but they have not been specifically ported to these platforms.
Sorry, I do not know what might go wrong there though.
-
@Francky033
how do you use QSplashScreen ( on desktop?) can you show some code, it may helpThat said, QSplashScreen does not work like you think it does on mobile devices.
It can only take effect once main() is called, before that the OS has specific options to display splash screen like stuff.
On iOS you have correctly identified it as UILaunchImage, but you can also do it with a storyboard
on Android it can be set in the manifest.xml file via
splash_screen_drawable
andsplash_screen_sticky
-
Hello J.Hilk !
In the Desktop versions (mac, linux, windows), the object created with QSplashScreen is displayed perfectly well. It also works correctly under Android ....
It is only under ios that QSplashScreen displays a black screen in the foreground that does not disappear even after the destruction of the object!
On the other hand, I had also made a Splash Screen in QML. The splash is not displayed under ios, except after the displaying a messageBox ! The Splash is correctly displayed after it !
How to explain this ? Does a Messagebox destroy the default iiOs Splash Screen of the application ?
Does the display of a MessagerBox forces the system to treat all the events ?
The problem that I see with UILaunchImage is that it does not make it possible to display an image and the loading of the objects by the program for example.
-
@Francky033
very strangecan you make a minimal compile-able example, so that we can test as well?
-
hI !
I finally dropped the idea of making a qml Splash Screen on ios.
As I couldn't do it manually, I followed this great tutorial which explains how to design it using XCode :https://www.youtube.com/watch?v=s4skYI4GaOg
Everything works now. I have a splash screen and an OpenGL window that work!