Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How can I consistently create QOpenGLWidget applications to show up?

How can I consistently create QOpenGLWidget applications to show up?

Scheduled Pinned Locked Moved Unsolved General and Desktop
30 Posts 3 Posters 4.7k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sailanarmo
    wrote on last edited by
    #1

    I've been having this problem for a while. I created an application that I can successfully display a black screen using the QOpenGLWidget on the Creator plopped inside of a QFrame or even on the QMainWindow itself. However, there are random times where I do the same thing, where nothing is on the QMainWindow except the OpenGLWidget and the program will not run. It just hangs and doesn't ever load the widget, doesn't load anything, just sits there until I am forced to close the program. This is about the fourth time this has happened to me.

    Has anyone run into this issue before? I don't really know how to replicate the problem.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You're not providing enough information:

      • What version of Qt ?
      • What OS ?
      • What graphics card ?
      • Can you reproduce that with a minimal compilable example ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        You're not providing enough information:

        • What version of Qt ?
        • What OS ?
        • What graphics card ?
        • Can you reproduce that with a minimal compilable example ?
        S Offline
        S Offline
        Sailanarmo
        wrote on last edited by Sailanarmo
        #3

        @SGaist

        On clicking About QT Creator gives me Qt Creator 4.8.2, Qt 5.12.1
        I am on Windows 10 Pro.
        I have a NVIDIA RTX 2080
        And like I said, all I did was open a new project, click edit, double click on the ui file, plop a OpenGLWidget on top of it, and press run.

        And then it just hangs forever.

        Then sometimes, if I recreate the same program, from scratch, it just works. Which is something I do not understand at all.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          The about Qt Creator dialog shows information about Qt Creator itself not the Qt version you are currently using to build your application.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          S 1 Reply Last reply
          0
          • SGaistS SGaist

            The about Qt Creator dialog shows information about Qt Creator itself not the Qt version you are currently using to build your application.

            S Offline
            S Offline
            Sailanarmo
            wrote on last edited by
            #5

            @SGaist How do I find that?

            1 Reply Last reply
            0
            • S Offline
              S Offline
              Sailanarmo
              wrote on last edited by Sailanarmo
              #6

              Update kind of a weird one. I updated my graphics driver. Started the program and it launched. I thought that was solution and then I closed the test program. Relaunched it and the same behavior happened. I then restarted my computer to see if it was the restart that kicked the program into shape. It did not. The behavior is still the same.

              As far as I know @SGaist, the version I am using to build Qt is 5.12.1. Unless there is something else I need to look up.

              I have tried with both VS2017 64bit compiler and MinGW-64 bit compiler and both produce the same behavior.

              1 Reply Last reply
              0
              • S Offline
                S Offline
                Sailanarmo
                wrote on last edited by
                #7

                @SGaist

                It is definitely QT 5.12.1. And to recreate the crash, as I have said, all I have done is:

                File->New File or Project->QT Application

                I then go to the ui file, drag an OpenGL Widget on the QMainwindow, hit save, then run.

                The program then hangs forever. It doesn't crash, doesn't connect to any server, just hangs there until I force quit the application.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  Sailanarmo
                  wrote on last edited by
                  #8

                  @SGaist

                  Update 2 Not sure why, but this seems to be a problem on Windows. I cloned down the project I was working on into my Linux machine running Ubuntu 17.04. There is no hang up whatsoever. I can develop from here, but this really isn't the most ideal way to develop if I can help it. I am also not sure if this is a bug within the Windows side of things.

                  What should I do from this point on?

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    You can start by updating your Qt version to the latest version of the 5.12 series. If it still crashes, you can also try the 5.13 beta.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    S 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      You can start by updating your Qt version to the latest version of the 5.12 series. If it still crashes, you can also try the 5.13 beta.

                      S Offline
                      S Offline
                      Sailanarmo
                      wrote on last edited by
                      #10

                      @SGaist

                      I did an update of QT and the same behavior has produced itself. I did not try the beta. That is something I can try here in an hour or two.

                      1 Reply Last reply
                      0
                      • fcarneyF Offline
                        fcarneyF Offline
                        fcarney
                        wrote on last edited by
                        #11

                        Is it practical to ever use a QOpenGLWidget without subclassing it anyway? Or promoting it? I thought using that widget would require a fair amount of opengl code to go with it.

                        C++ is a perfectly valid school of magic.

                        S 1 Reply Last reply
                        0
                        • fcarneyF fcarney

                          Is it practical to ever use a QOpenGLWidget without subclassing it anyway? Or promoting it? I thought using that widget would require a fair amount of opengl code to go with it.

                          S Offline
                          S Offline
                          Sailanarmo
                          wrote on last edited by
                          #12

                          @fcarney That is what I am doing. I create a class, and then with the widget I promote it to that class. At least this is what I am attempting to do with my current program in Windows. However, like I said, it just hangs there for no reason. It doesn't crash, just hangs, no errors.

                          So to recreate it, I just created a new project from scratch and then threw the widget on there and hit run. Again, same behavior. But, when I go to Ubuntu 17.04, there is no issue, the program runs just fine. Which tells me there is something wrong with the windows side of things.

                          I was able to finish my project within Linux, however, getting it to run in Window's will now be the trick because it doesn't want to run in Windows. It just hangs there.

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            Sailanarmo
                            wrote on last edited by
                            #13

                            @SGaist

                            Went to 5.12.3 and I have the same results on Windows. I've tried with 5.12.1, 5.12.2, and now 5.12.3 and all have the same exact behavior.
                            which is odd, because the one application in which my opengl program works was ran with 5.12.1. So I don't really know why it would start acting this way now.

                            1 Reply Last reply
                            0
                            • S Offline
                              S Offline
                              Sailanarmo
                              wrote on last edited by
                              #14

                              Update 3

                              I uninstalled and reinstalled QT. And that did not work either, I really do not understand why this is happening as I don't think I have done anything different from the past. I am not sure if this is a bug, since I seem to be the only one suffering from this problem. I have attached images of one of my programs running, another image of the program I am working on hanging, and a final image showing how simple the ui looks compared to the one that is working.

                              So I do not know what to do from here. Again, I am not sure if this is something I am doing wrong, if it is a bug, or maybe it is just my computer. I have tried this program in both Linux and MacOSX and it runs just fine. However, when I try this in Windows. It doesn't work at all. So I am at a complete loss of what to try. I have also linked the code that I am working on if anyone would like to clone it down and try running it. You must have C++17 in order for this program to run however.

                              Image 1: 0_1557514009366_workingProgram.png

                              Image 2:0_1557514023567_nonWorkingProgram.png

                              Image 3: 0_1557514053611_theui.png

                              Github link: https://github.com/Sailanarmo/ControllerTest

                              @SGaist @fcarney or anyone who would like to help out. This is as far as I can get. Where do I go from here?

                              1 Reply Last reply
                              0
                              • SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on last edited by
                                #15

                                It might be a graphics card driver issue. Can you test your application on a Windows machine with a different card ? Or update/downgrade your Nvidia drivers.

                                Interested in AI ? www.idiap.ch
                                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                1 Reply Last reply
                                0
                                • S Offline
                                  S Offline
                                  Sailanarmo
                                  wrote on last edited by
                                  #16

                                  @SGaist

                                  I will go ahead and try that next. That is the only thing I haven't done. I have updated my Nvidia drivers to their latest versions. It's just odd to me since my linux partition is using the same graphics card as my Windows machine. When I get home I will test it on my Windows Machine there.

                                  Thank you for working with me.

                                  1 Reply Last reply
                                  0
                                  • SGaistS Offline
                                    SGaistS Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #17

                                    Then we can rule out a hardware related issue. So it's very likely the driver. Even if the same version, these are still two radically different platforms.

                                    Interested in AI ? www.idiap.ch
                                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    1 Reply Last reply
                                    0
                                    • S Offline
                                      S Offline
                                      Sailanarmo
                                      wrote on last edited by
                                      #18

                                      @SGaist

                                      I will uninstall my graphics driver and reinstall them. I will let you know what happens.

                                      1 Reply Last reply
                                      0
                                      • S Offline
                                        S Offline
                                        Sailanarmo
                                        wrote on last edited by
                                        #19

                                        @SGaist

                                        I've uninstalled the graphics drivers and I attempted to launch the same application without the drivers. The same behavior happened. I then reinstalled the graphics drivers and launched the program, and the same behavior happened.

                                        I could try downgrading my driver version. But I do not know where to go to find a lesser version of my drivers. I also don't know, why Qt chooses to launch one application, and not the other just fine. It's all very confusing.

                                        1 Reply Last reply
                                        0
                                        • S Offline
                                          S Offline
                                          Sailanarmo
                                          wrote on last edited by
                                          #20

                                          @SGaist

                                          I just launched the program from my home. It launches just fine. Only difference is that I am running a GTX 1080ti instead of an RTX 2080. I know I am repeating the same thing, but I do not understand why the linux machine with the same physical graphics card runs the program fine. But when I switch to the windows partition, it craps out.

                                          I'm kind of at a loss here. Maybe it is a hardware issue within windows itself. Or maybe it's a one time fluke and it is only affecting me.

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved