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. QGLWidget ceased to work on Windows in Qt 5.7?
Qt 6.11 is out! See what's new in the release blog

QGLWidget ceased to work on Windows in Qt 5.7?

Scheduled Pinned Locked Moved Unsolved General and Desktop
23 Posts 4 Posters 7.8k Views 4 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.
  • mrjjM mrjj

    Well, you should test on other win 10 then.
    The QGLWidget samples seems to work fine on win 10 when i run it.

    Did you try the sample ? Does it also produce black on that pc?

    V Offline
    V Offline
    Violet Giraffe
    wrote on last edited by Violet Giraffe
    #6

    @mrjj
    My glClear example from the first post produces black when combined with Qt 5.7 and orange (expected) with 5.5.
    Meanwhile, hellogl example crashes.

    mrjjM 1 Reply Last reply
    0
    • V Violet Giraffe

      @mrjj
      My glClear example from the first post produces black when combined with Qt 5.7 and orange (expected) with 5.5.
      Meanwhile, hellogl example crashes.

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #7

      @Violet-Giraffe
      So it seems that QGLWidget and that win 10 have issues?
      Tried hellogl on 3 very different win 10 pc and it worked.

      So if same sample crashes on the test pc you have, i would
      think its driver issue that first surfaces when using 5.7.

      V 1 Reply Last reply
      0
      • V Offline
        V Offline
        Violet Giraffe
        wrote on last edited by
        #8

        OK, I have tried replacing the direct GL function calls with QOpenGLFunctions_1_1 (and then QOpenGLFunctions_2_0). But some of the functions I need are not loaded by that class. E. g. glMaterialfv: there is a method for that

        inline void QOpenGLFunctions_2_0::glMaterialfv(GLenum face, GLenum pname, const GLfloat *params)
        {
            d_1_0_Deprecated->f.Materialfv(face, pname, params);
        }
        

        Here f is a structure holding pointers to OpenGL functions, and it doesn't have a single non-nullptr field.

        1 Reply Last reply
        0
        • mrjjM mrjj

          @Violet-Giraffe
          So it seems that QGLWidget and that win 10 have issues?
          Tried hellogl on 3 very different win 10 pc and it worked.

          So if same sample crashes on the test pc you have, i would
          think its driver issue that first surfaces when using 5.7.

          V Offline
          V Offline
          Violet Giraffe
          wrote on last edited by Violet Giraffe
          #9

          The example's problem is the same: it didn't load any OpenGL functions into d_1_0_Deprecated->f. But I don't care about the example. You know my drivers are OK and they do supply these functions because the same code works when compiled and linked with Qt 5.5 (didn't try 5.6) and calling OpenGL functions directly from OpenGl32.lib.

          1 Reply Last reply
          0
          • mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #10

            ok, But you dont find it odd that the
            hellogl sample here works with 5.7 on all win 10 , i could test on?

            But on that pc, you say it crash?

            1 Reply Last reply
            0
            • V Offline
              V Offline
              Violet Giraffe
              wrote on last edited by
              #11

              Yes, it crashes because it fails to load OpenGL function pointers into d_1_0_Deprecated->f. I'm fairly sure it's a Qt bug. And there's no saying how many users of my app will experience this bug as well.

              mrjjM 1 Reply Last reply
              0
              • V Violet Giraffe

                Yes, it crashes because it fails to load OpenGL function pointers into d_1_0_Deprecated->f. I'm fairly sure it's a Qt bug. And there's no saying how many users of my app will experience this bug as well.

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by
                #12

                @Violet-Giraffe
                well if its a bug in Qt it must
                be with certain hardware or drivers as i cannot make sample fail with the
                hardware with win 10, i have at work.

                You can look in
                https://bugreports.qt.io/secure/Dashboard.jspa
                if it has been reported before.

                V 1 Reply Last reply
                0
                • mrjjM mrjj

                  @Violet-Giraffe
                  well if its a bug in Qt it must
                  be with certain hardware or drivers as i cannot make sample fail with the
                  hardware with win 10, i have at work.

                  You can look in
                  https://bugreports.qt.io/secure/Dashboard.jspa
                  if it has been reported before.

                  V Offline
                  V Offline
                  Violet Giraffe
                  wrote on last edited by Violet Giraffe
                  #13

                  @mrjj Indeed, it seems to occur only on some systems, but a bug nevertheless. I didn't find a corresponding issue in the tracker. I would report it but don't see a point - they probably won't be able to reproduce it as well. Seeing that the bugs I reported 2 years ago still aren't fixed, I'm not enthusiastic about spending more time trying to make Qt better. Just need to find the quickest way to restore functionality of my application.

                  1 Reply Last reply
                  0
                  • mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on last edited by
                    #14

                    Well I had hoped I could reproduce it
                    as clear reproduction steps is needed.

                    However, since QGLWidget is considered obsolete in 5.7,
                    I doubt the devs will spend much energy to correct it anyway.

                    1 Reply Last reply
                    0
                    • V Offline
                      V Offline
                      Violet Giraffe
                      wrote on last edited by
                      #15

                      The problem with hellogl example is not in QGLWidget. I'm about to try QOpenGLWidget instead, and I'm sure it will fail just the same. It's the QOpenGLFunctions_xx classes that are broken, although it doesn't explain why my application stopped working. I never used these classes.

                      1 Reply Last reply
                      0
                      • V Offline
                        V Offline
                        Violet Giraffe
                        wrote on last edited by Violet Giraffe
                        #16

                        No functions are loaded into QOpenGLFunctions_x_x::d_x_x_Deprecated tables. That's d_1_0_Deprecated, d_1_2_Deprecated and d_1_4_Deprecated. And I need some functions from there. So it makes no difference what kind of widget I will use, the old or the new one.

                        Unless I make direct OpenGL calls, of course, but direct calls are broken with Qt 5.7 as well. I don't understand why, but they are.

                        1 Reply Last reply
                        1
                        • V Offline
                          V Offline
                          Violet Giraffe
                          wrote on last edited by
                          #17

                          Update: the required functions are loaded in Qt 5.5 - but not in 5.7. I have Qt sources, I can debug if someone tells me where to look.

                          kshegunovK 1 Reply Last reply
                          1
                          • V Violet Giraffe

                            Update: the required functions are loaded in Qt 5.5 - but not in 5.7. I have Qt sources, I can debug if someone tells me where to look.

                            kshegunovK Offline
                            kshegunovK Offline
                            kshegunov
                            Moderators
                            wrote on last edited by
                            #18

                            @Violet-Giraffe

                            direct calls are broken with Qt 5.7 as well. I don't understand why, but they are.

                            Then the problem (probably) has little to do with Qt. Qt only resolves the functions' addresses for you. List the symbols from your OpenGL library (the one you link against), see if it exports the deprecated functions you want to use.

                            Update: the required functions are loaded in Qt 5.5 - but not in 5.7. I have Qt sources, I can debug if someone tells me where to look.

                            <Qt source dir>/qtbase/src/gui/opengl
                            

                            Read and abide by the Qt Code of Conduct

                            V 1 Reply Last reply
                            0
                            • kshegunovK kshegunov

                              @Violet-Giraffe

                              direct calls are broken with Qt 5.7 as well. I don't understand why, but they are.

                              Then the problem (probably) has little to do with Qt. Qt only resolves the functions' addresses for you. List the symbols from your OpenGL library (the one you link against), see if it exports the deprecated functions you want to use.

                              Update: the required functions are loaded in Qt 5.5 - but not in 5.7. I have Qt sources, I can debug if someone tells me where to look.

                              <Qt source dir>/qtbase/src/gui/opengl
                              
                              V Offline
                              V Offline
                              Violet Giraffe
                              wrote on last edited by Violet Giraffe
                              #19

                              @kshegunov said in QGLWidget ceased to work on Windows in Qt 5.7?:

                              List the symbols from your OpenGL library (the one you link against), see if it exports the deprecated functions you want to use.

                              I link with Windows default OpenGL32.lib. It's the same in both cases.

                              <Qt source dir>/qtbase/src/gui/opengl
                              

                              That's not helpful.

                              kshegunovK 1 Reply Last reply
                              0
                              • V Violet Giraffe

                                @kshegunov said in QGLWidget ceased to work on Windows in Qt 5.7?:

                                List the symbols from your OpenGL library (the one you link against), see if it exports the deprecated functions you want to use.

                                I link with Windows default OpenGL32.lib. It's the same in both cases.

                                <Qt source dir>/qtbase/src/gui/opengl
                                

                                That's not helpful.

                                kshegunovK Offline
                                kshegunovK Offline
                                kshegunov
                                Moderators
                                wrote on last edited by
                                #20

                                @Violet-Giraffe said in QGLWidget ceased to work on Windows in Qt 5.7?:

                                I link with Windows default OpenGL32.lib. It's the same in both cases.

                                There's no such thing. The lib file is part of the Windows SDK.
                                Are you using a statically built Qt? How did you install, Qt may be linked against another GL, or it may be resolving the functions at runtime (which is rather probable on desktop). Just list the symbols from opengl32.dll and see what's exported.

                                That's not helpful.

                                How so? It is where you should look if you intend to debug ...

                                Read and abide by the Qt Code of Conduct

                                V 1 Reply Last reply
                                0
                                • kshegunovK kshegunov

                                  @Violet-Giraffe said in QGLWidget ceased to work on Windows in Qt 5.7?:

                                  I link with Windows default OpenGL32.lib. It's the same in both cases.

                                  There's no such thing. The lib file is part of the Windows SDK.
                                  Are you using a statically built Qt? How did you install, Qt may be linked against another GL, or it may be resolving the functions at runtime (which is rather probable on desktop). Just list the symbols from opengl32.dll and see what's exported.

                                  That's not helpful.

                                  How so? It is where you should look if you intend to debug ...

                                  V Offline
                                  V Offline
                                  Violet Giraffe
                                  wrote on last edited by Violet Giraffe
                                  #21

                                  @kshegunov said in QGLWidget ceased to work on Windows in Qt 5.7?:

                                  The lib file is part of the Windows SDK.

                                  My point exactly! It's the same no matter which Qt version I build with. I have a normal dynamic Qt obtained with the online installer, no tricks.
                                  Moreover, I only have one instance of opengl32.dll on my computer so there's no point in checking its exports - we already know it works and the problem is somewhere in Qt, most likely.

                                  How so? It is where you should look if you intend to debug ...

                                  Yeah, but I need to know where to set breakpoints to debug OpenGL 1.0 linking issue, not which folder the sources are in.

                                  1 Reply Last reply
                                  0
                                  • ? Offline
                                    ? Offline
                                    A Former User
                                    wrote on last edited by
                                    #22

                                    Hi! Can you tell us which OpenGL core profile you're using?

                                    V 1 Reply Last reply
                                    1
                                    • ? A Former User

                                      Hi! Can you tell us which OpenGL core profile you're using?

                                      V Offline
                                      V Offline
                                      Violet Giraffe
                                      wrote on last edited by
                                      #23

                                      @Wieland
                                      I've tried 1.1 and 2.0. I need 2.0 eventually. I even specified it with setFormat - to no avail still.

                                      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