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 - Blank Screen on different computer
Forum Update on Monday, May 27th 2025

QGLWidget - Blank Screen on different computer

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 4 Posters 3.6k Views
  • 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.
  • A Offline
    A Offline
    Anonym
    wrote on last edited by Anonym
    #1

    Hi all!

    When I wanted to test my project (using QT 5.7 via VS-Addin) as release build on a different computer/OS I noticed, that the QGLWidget is just black (for normal the background should be grey with some text). (The exe as debug/release is just showing the QGLWidget correctly at the development-computer)

    What I've tried:
    I'm shipping the exe with all neccessary DLL's (added by windeployqt.exe). I've even checked the dependencies with Dependency Walker and everything seems fine. To avoid differencies in the OpenGL version, I've shipped opengl32.dll and glu32.dll from system32-folder. That sadly didn't change anything. Then I printed a MessageBox with the current OpenGL-Version (QGLFormat::majorVersion( )) to see if there is something wrong on the other computer. But on both computers he's returning value 2 as major version.

    After that, I followed a tip from someone in the internet saying, to run the console viá "CONFIG += console". The console outputs the following on the testing-computer:
    "QGLWidget::RenderText is not supported under OpenGL/ES".

    I'm despairing, because I've spent several days in searching the internet. But nothing made it working. In my opinion, there can be only missing some DLL's, as the exe is showing the QGLWidget just fine on the developer computer.

    (Im using Qt 5.7 and I'm developing/testing the project on Win 7 64-bit)

    Thanks ahead everyone!

    M 1 Reply Last reply
    0
    • A Anonym

      Hi all!

      When I wanted to test my project (using QT 5.7 via VS-Addin) as release build on a different computer/OS I noticed, that the QGLWidget is just black (for normal the background should be grey with some text). (The exe as debug/release is just showing the QGLWidget correctly at the development-computer)

      What I've tried:
      I'm shipping the exe with all neccessary DLL's (added by windeployqt.exe). I've even checked the dependencies with Dependency Walker and everything seems fine. To avoid differencies in the OpenGL version, I've shipped opengl32.dll and glu32.dll from system32-folder. That sadly didn't change anything. Then I printed a MessageBox with the current OpenGL-Version (QGLFormat::majorVersion( )) to see if there is something wrong on the other computer. But on both computers he's returning value 2 as major version.

      After that, I followed a tip from someone in the internet saying, to run the console viá "CONFIG += console". The console outputs the following on the testing-computer:
      "QGLWidget::RenderText is not supported under OpenGL/ES".

      I'm despairing, because I've spent several days in searching the internet. But nothing made it working. In my opinion, there can be only missing some DLL's, as the exe is showing the QGLWidget just fine on the developer computer.

      (Im using Qt 5.7 and I'm developing/testing the project on Win 7 64-bit)

      Thanks ahead everyone!

      M Offline
      M Offline
      mtrch
      wrote on last edited by
      #2

      @Anonym said in QGLWidget - Blank Screen on different computer:

      Then I printed a MessageBox with the current OpenGL-Version (QGLFormat::majorVersion( )) to see if there is something wrong on the other computer. But on both computers he's returning value 2 as major version.

      Check values of glGetString(GL_VERSION), glGetString(GL_RENDERER), glGetString(GL_VENDOR) and QOpenGLContext::​isOpenGLES(). Maybe your application started using ANGLE OpenGL ES, because graphics drivers not installed/not supports OpenGL >= 2.0.

      To avoid differencies in the OpenGL version, I've shipped opengl32.dll and glu32.dll from system32-folder
      Shipping files from system32 is wrong and useless.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Anonym
        wrote on last edited by
        #3

        Thanks mtrch for your help!

        Your tip lead me in the right direction. For everyone facing the same problem:
        I solved the issue by telling QApplication what kind of OpenGL to use:

        QApplication a( argc, argv );
        a.setAttribute( Qt::AA_UseDesktopOpenGL );
        //MainWindow and stuff like that after this...
        
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi and welcome to devnet,

          IIRC, you should set that property before creating your QApplication object.

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

          A 1 Reply Last reply
          0
          • SGaistS SGaist

            Hi and welcome to devnet,

            IIRC, you should set that property before creating your QApplication object.

            A Offline
            A Offline
            Anonym
            wrote on last edited by
            #5

            @SGaist
            Probably I don't know how to do that? Is there a static function or something like that?

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

              You're already using the correct function but the wrong way. setAttribute is a static function.

              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
              1
              • S Offline
                S Offline
                sir_clive
                wrote on last edited by
                #7

                I know this is a very old topic, but still THANK YOU! You just saved my life, I was already going crazy with this issue!

                To all other poor souls that might have the same issue: my problem was that with Qt 5.4, the QGLWidget and QOpenGLWIdget both worked like a champ, while after upgrade to Qt 5.10, on some computers (very rare actually), I got the black screen no matter what I did. I only managed to reproduce that problem on my system under Virtual Box, other than that, I only received one single complaint about this issue (tested on at least 15 different computers under Windows, Linux and OSX, including also VMWare and Parallels installations).

                Calling QApplication::setAttribute(Qt::AA_UseDesktopOpenGL) before creating the QApplication derived object solved it for me.

                1 Reply Last reply
                2

                • Login

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