Congratulations to our 2022 Qt Champions!

OpenGL setup for iOS using Qt 5.4 issues [SOLVED]

  • I've updated to Qt 5.4 and now I'm back to refighting some battles with just basic openGL setup on the iOS device.

    I'm writing a tool that has two parts: a QPlainTextEdit window and a OpenGL window below it (which previously was a QGLWidget). both of these widgets are parented to a QVBoxLayout. Everything has been find in Qt 5.3.

    In Qt 5.4, all my openGL stuff is broken.

    So I turned to the examples that claim to work on iOS. The only example that works is the OpenGL Window Example. The one with the multi-colored spinning triangle. But it uses an implementation that I'm unfamiliar with. It uses a QWindow. Since its not a widget, I can't parent it to the QVBoxLayout.

    All other examples use a QOpenGLWidget. Which it complains is not compatible with the iphone.

    Any advice?

  • I just discovered what my issues were. When I upgraded to Qt 5.4, I was still building with the Qt 5.3 projects. I just threw them away and readded iphone and android to my project and everything is fine with my original QGLWidget design. Phew! dodged a bullet for now.

  • Lifetime Qt Champion


    Glad you found out and thanks for sharing ! Can you also update the thread title prepending [solved] so other forum users may know a solution has been found :)

  • I might have spoke premature. I seem to have reactivated the problem somehow and I can't fix it again.

    My project has two library projects. For some reason, the make file file keeps insisting that these two libraries get compiled using the ios 7.1 sdk. Here's the line from the make file:

    @-isysroot /Applications/

    Where does the 7.1 library get set?! Its supposed to be the 8.1 library. The main project file compiles using 8.1.

  • Its definitely linked to this SDK issue. My theory is I've checked in some file that tells the make command to use the 7.1 library. I've just went through the project and deleted all build files and it compiled with 8.1.

    I suspect when I did a merge, I reintroduced the file that tells Qt to use the 7.1 sdk. When I find it, I'll post my findings.

  • Lifetime Qt Champion

    Got any .pro.user in your repository ?

  • I do. But they are not checked into the repository. They are just sitting in the folder.

  • actually a whole bunch of them. Also, it appears that the file that kept on adding the 7.1 sdk was a file called .qmake.stash. When I deleted it, Qt rebuilt it and the 7.1 issue went away

  • Okay, now I think I've solved the problems. The fix was I had to delete the .qmake.stash file in every sub dir projects. In my particular case, I had my main application with two sub projects. Each of those files had a .qmake.stash file. When I opened that file, it showed it was inserting the 7.1 sdk.

    Once Qt rebuilt the project, it made new corrected .qmake.stash files in their respective projects.

    One note about .qmake.stash is its normally hidden. So if you don't see it, you will need to show hidden files.

    Here's a good article on how to make hidden files show up on your Mac: "here":

  • Lifetime Qt Champion

    .pro.user file contains the configuration of Qt Creator for you project e.g. the Qt version and kit

Log in to reply