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. QOpenGLContext does not works in debug with QtCreator 4.7
Forum Updated to NodeBB v4.3 + New Features

QOpenGLContext does not works in debug with QtCreator 4.7

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 3 Posters 1.9k 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.
  • Roy44R Offline
    Roy44R Offline
    Roy44
    wrote on last edited by
    #1

    Hi,
    I update Qt creator to version 4.7 (windows) and know my application does not work correctly because QOpenGLContext seems dont' work in debug now.

    In Qt Creator 4.6 I had no problem

    QSurfaceFormat format;
            format.setMajorVersion(10);
            format.setProfile(QSurfaceFormat::CoreProfile);
            QOffscreenSurface offscreen;
            offscreen.setFormat(format);
            offscreen.create();
            QOpenGLContext ctxt;
            ctxt.setFormat(format);
            ctxt.create();
            QOpenGLContext* pCurrent = QOpenGLContext::currentContext();
    
            if(ctxt.makeCurrent(&offscreen))
            {
    //
            }
    

    works well with Qt creator 4.6, in 4.7 pCurrent is null and make current return false.
    The problem is only in debug mode
    in realease it works fine.
    Is it a known bug.
    How can I return to version 4.6 ?
    thanks.

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

      hi
      But Qt Creator is a Text editor. its not the Qt version.
      Did you also upgrade your Qt ?

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

        Hi,

        You can check the bug report system to see if there's something related.

        As for older versions of Qt Creator, you can find them here.

        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
        • Roy44R Offline
          Roy44R Offline
          Roy44
          wrote on last edited by
          #4

          I said QtCreator, I mean the Qt CDB debugger 4.7, I'm currently in Qt 5.11.0 I will update to 5.11.1

          1 Reply Last reply
          0
          • Roy44R Offline
            Roy44R Offline
            Roy44
            wrote on last edited by
            #5

            same trouble in Qt 5.11.1

            1 Reply Last reply
            0
            • Roy44R Offline
              Roy44R Offline
              Roy44
              wrote on last edited by
              #6

              I made a test:

              MainWindow::MainWindow(QWidget *parent) :
                  QMainWindow(parent),
                  ui(new Ui::MainWindow)
              {
                  ui->setupUi(this);
              
                  QString openGLVers;
                  QString openGLVendor;
                  QString openGLRenderer;
                  QString openGLExtension;
              
              
                  QSurfaceFormat format;
                  format.setMajorVersion(4);
                  format.setProfile(QSurfaceFormat::CoreProfile);
                  QOffscreenSurface offscreen;
                  offscreen.setFormat(format);
                  offscreen.create();
                  QOpenGLContext ctxt;
                  ctxt.setFormat(format);
                  ctxt.create();
                  QOpenGLContext* pCurrent = QOpenGLContext::currentContext();
              
                  if(ctxt.makeCurrent(&offscreen))
                  {
                      openGLVers = QString((char*)ctxt.functions()->glGetString(GL_VERSION));
                      openGLVendor = QString((char*)ctxt.functions()->glGetString(GL_VENDOR));
                      openGLExtension = QString((char*)ctxt.functions()->glGetString(GL_EXTENSIONS));
                      openGLRenderer =  QString((char*)ctxt.functions()->glGetString(GL_RENDERER));
              
                      qDebug() << openGLVers;
                      qDebug() << openGLVendor;
                      qDebug() << openGLExtension;
                      qDebug() << openGLRenderer;
              
                      ui->lblRenderer->setText(openGLRenderer);
                      ui->lblVendor->setText(openGLVendor);
                      ui->lblVer->setText(openGLVers);
                  }
              }
              

              Doest not work in debug and release (if launch from QtCreator)
              I have error QWindowsEGLContext: Failed to create context, eglError: 3005, this: 0x5ac3470

              If I launch my small exe from explorer It works.

              1 Reply Last reply
              0
              • Roy44R Offline
                Roy44R Offline
                Roy44
                wrote on last edited by
                #7

                I confirm it's a bug (I rebuild with QtCreator 4.6.2 and it's works).
                thanks for the link to QtCreator 4.6.2

                mrjjM 1 Reply Last reply
                0
                • Roy44R Roy44

                  I confirm it's a bug (I rebuild with QtCreator 4.6.2 and it's works).
                  thanks for the link to QtCreator 4.6.2

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

                  @Roy44
                  But still Qt 5.11.1 ?

                  1 Reply Last reply
                  0
                  • Roy44R Offline
                    Roy44R Offline
                    Roy44
                    wrote on last edited by
                    #9

                    I'm stll in Qt 5.11.1.

                    1 Reply Last reply
                    0
                    • Roy44R Offline
                      Roy44R Offline
                      Roy44
                      wrote on last edited by
                      #10

                      I found a similar problem here
                      https://forum.qt.io/topic/92780/shader-fails-to-compile-after-upgrading-to-qt-creator-4-7/6

                      And the same solution solve my problem.

                      1 Reply Last reply
                      3

                      • Login

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