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. OpenGL application runs only outside QtCreator
Forum Updated to NodeBB v4.3 + New Features

OpenGL application runs only outside QtCreator

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 5 Posters 1.3k Views 1 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.
  • D Offline
    D Offline
    deleted427
    wrote on last edited by
    #1

    Windows platform. A software that used to be compiled with Qt 4.8 and OpenGL (via OpenInventor library with SoQt). Now I am trying the same with Qt 5.6.3, MSVC 2013 (32-bit). I have compiled also all the required libraries with the same toolset, so it should fit.

    The effect is now strange: If I run the compiled exe outside of QtCreator - everything is fine. However, if I run it from inside, this is the message I receive:

    QObject::connect: No such slot SoQtGLWidgetP::gl_changed()
    QObject::connect: (sender name: 'QtGLAreaWindow')
    Coin warning in cc_glglue_instance(): Error when setting up the GL context. This can happen if there is no current context, or if the context has been set up incorrectly.

    The application does not crash, it shows the OpenGL window - black and empty.

    And the strange thing is: This happens ONLY inside the QtCreator!

    I made sure that both inside and outside the same dlls are found. Also I copied once exactly the same path to a command line, set it there manually and started my appliction: Again it worked perfectly - as soon as it is out of QtCreator!

    This is annoying because I actually need to do some debugging, with debugger or debut output, and with the current situation I am constrained to do this with popping up message boxes here and there...

    Is there anything in QtCreator that blocks proper operation of OpenGL - in some "good old style"? I know that Qt currently uses some Google OpenGL emulator (Angle) - but is it possible that this thing is somehow interfering?

    JonBJ J.HilkJ aha_1980A 3 Replies Last reply
    0
    • D deleted427

      Windows platform. A software that used to be compiled with Qt 4.8 and OpenGL (via OpenInventor library with SoQt). Now I am trying the same with Qt 5.6.3, MSVC 2013 (32-bit). I have compiled also all the required libraries with the same toolset, so it should fit.

      The effect is now strange: If I run the compiled exe outside of QtCreator - everything is fine. However, if I run it from inside, this is the message I receive:

      QObject::connect: No such slot SoQtGLWidgetP::gl_changed()
      QObject::connect: (sender name: 'QtGLAreaWindow')
      Coin warning in cc_glglue_instance(): Error when setting up the GL context. This can happen if there is no current context, or if the context has been set up incorrectly.

      The application does not crash, it shows the OpenGL window - black and empty.

      And the strange thing is: This happens ONLY inside the QtCreator!

      I made sure that both inside and outside the same dlls are found. Also I copied once exactly the same path to a command line, set it there manually and started my appliction: Again it worked perfectly - as soon as it is out of QtCreator!

      This is annoying because I actually need to do some debugging, with debugger or debut output, and with the current situation I am constrained to do this with popping up message boxes here and there...

      Is there anything in QtCreator that blocks proper operation of OpenGL - in some "good old style"? I know that Qt currently uses some Google OpenGL emulator (Angle) - but is it possible that this thing is somehow interfering?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @CoBo
      Does https://forum.freecadweb.org/viewtopic.php?f=3&t=5636#p113507 shed any light on your situation?

      1 Reply Last reply
      0
      • D deleted427

        Windows platform. A software that used to be compiled with Qt 4.8 and OpenGL (via OpenInventor library with SoQt). Now I am trying the same with Qt 5.6.3, MSVC 2013 (32-bit). I have compiled also all the required libraries with the same toolset, so it should fit.

        The effect is now strange: If I run the compiled exe outside of QtCreator - everything is fine. However, if I run it from inside, this is the message I receive:

        QObject::connect: No such slot SoQtGLWidgetP::gl_changed()
        QObject::connect: (sender name: 'QtGLAreaWindow')
        Coin warning in cc_glglue_instance(): Error when setting up the GL context. This can happen if there is no current context, or if the context has been set up incorrectly.

        The application does not crash, it shows the OpenGL window - black and empty.

        And the strange thing is: This happens ONLY inside the QtCreator!

        I made sure that both inside and outside the same dlls are found. Also I copied once exactly the same path to a command line, set it there manually and started my appliction: Again it worked perfectly - as soon as it is out of QtCreator!

        This is annoying because I actually need to do some debugging, with debugger or debut output, and with the current situation I am constrained to do this with popping up message boxes here and there...

        Is there anything in QtCreator that blocks proper operation of OpenGL - in some "good old style"? I know that Qt currently uses some Google OpenGL emulator (Angle) - but is it possible that this thing is somehow interfering?

        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        @CoBo
        I have a very similar issue with my openglwidget application, every other build/compilation I get a black screen instead of my scene. When that happens I delete the build folder and make a complete rebuild.

        Until it breaks a gain, than rinse and repeat.

        If you find a solution, share it with us :-)


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        1 Reply Last reply
        0
        • D deleted427

          Windows platform. A software that used to be compiled with Qt 4.8 and OpenGL (via OpenInventor library with SoQt). Now I am trying the same with Qt 5.6.3, MSVC 2013 (32-bit). I have compiled also all the required libraries with the same toolset, so it should fit.

          The effect is now strange: If I run the compiled exe outside of QtCreator - everything is fine. However, if I run it from inside, this is the message I receive:

          QObject::connect: No such slot SoQtGLWidgetP::gl_changed()
          QObject::connect: (sender name: 'QtGLAreaWindow')
          Coin warning in cc_glglue_instance(): Error when setting up the GL context. This can happen if there is no current context, or if the context has been set up incorrectly.

          The application does not crash, it shows the OpenGL window - black and empty.

          And the strange thing is: This happens ONLY inside the QtCreator!

          I made sure that both inside and outside the same dlls are found. Also I copied once exactly the same path to a command line, set it there manually and started my appliction: Again it worked perfectly - as soon as it is out of QtCreator!

          This is annoying because I actually need to do some debugging, with debugger or debut output, and with the current situation I am constrained to do this with popping up message boxes here and there...

          Is there anything in QtCreator that blocks proper operation of OpenGL - in some "good old style"? I know that Qt currently uses some Google OpenGL emulator (Angle) - but is it possible that this thing is somehow interfering?

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi @CoBo,

          could it be QTCREATORBUG-20808?

          Qt has to stay free or it will die.

          E 1 Reply Last reply
          0
          • aha_1980A aha_1980

            Hi @CoBo,

            could it be QTCREATORBUG-20808?

            E Offline
            E Offline
            eti_nne
            wrote on last edited by
            #5

            @aha_1980
            +1
            I had the same problem once, and I solved by adding just adding

            application.setAttribute(Qt::AA_UseDesktopOpenGL);
            
            D 1 Reply Last reply
            1
            • E eti_nne

              @aha_1980
              +1
              I had the same problem once, and I solved by adding just adding

              application.setAttribute(Qt::AA_UseDesktopOpenGL);
              
              D Offline
              D Offline
              deleted427
              wrote on last edited by
              #6

              Thanks for all your competent hints and comments!

              @eti_nne This was actually the kind of solution that I hoped to receive in the first place: some setting, some environment variable, some attribute etc. However also this did not help so far... I just added such a line in my main(), immediately after generating the QApplication, but this had no effect.

              All others assumed that it might be a bug in the QtCreator, which led me to the idea try a more recent version, so I switched from 4.3.1 to 4.7.1 - also no effect so far.

              Two more options are still possible to try:

              a) move from Qt 5.6.3 to a more recent version

              b) try on a "real" Windows 10 machine: so far I am doing all my development and testing in a virtual machine that is actually running on a Linux system (OpenSuse Leap 42.3)

              Both are getting now more and more time consuming (download, install, reconfigure...), so for the moment I will have to switch this project to second priority: Basically I want to run that old software on my recent system - which actually works as long as I do not try to run inside QtCreator! But I found some stupid little bugs that I wanted to debug and remove which is a bit tedious with the need to do all test runs outside of QtCreator.

              Ah, ok, this brings me to still another option that I can try (but also takes time...):

              c) try the compilation and debugging in the Visual Studio

              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