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. Can not set renderable type from OpenGLES to OpenGL in Qt 5.7.0
Forum Update on Monday, May 27th 2025

Can not set renderable type from OpenGLES to OpenGL in Qt 5.7.0

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 1.4k 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.
  • P Offline
    P Offline
    pvt.peter
    wrote on last edited by pvt.peter
    #1

    Hi,

    I have worked on a project which used Qt 5.4.1 with OpenGL, here is the installer which i installed earlier:
    qt-opensource-windows-x86-msvc2013_opengl-5.4.1.exe

    After, we have done an upgrade from Qt 5.4.1 to Qt 5.7.0, so i installed this package:
    qt-opensource-windows-x86-msvc2013-5.7.0.exe

    On this project, we use OpenGL shared context too, which is works perfectly under Qt 5.4.1.
    After upgade to Qt 5.7.0, we got unexpected errors.

    The main problem is: i can not set individual QSurfaceFormat for QOpenGLContext. I would like to use OpenGL as RenderableType.
    So, i create a QSurfaceFormat, and passed to to QOpenGLContext::setFormat().

    QSurfaceFormat format;
    format.setVersion(2, 0); // OpenGL 2.0
    format.setProfile(QSurfaceFormat::CoreProfile);
    format.setRenderableType(QSurfaceFormat::RenderableType::OpenGL);
    
    QOpenGLContext *shareContext = QOpenGLContext::globalShareContext();
    
    shareContext->isOpenGLES(); // true
    shareContext->format().version(); // QPair(2,0) -> OpenGL 2.0
    shareContext->format().renderableType(); // 2 -> QSurfaceFormat::RenderableType::OpenGLES
    
    shareContext->setFormat(glFormat);
    shareContext->create();
    
    shareContext->isOpenGLES(); // true
    shareContext->format().version(); // QPair(2,0) -> OpenGL 2.0
    shareContext->format().renderableType(); // 2 -> QSurfaceFormat::RenderableType::OpenGLES
    

    What is the problem?
    It is like, there is a global setting to RenderableType as OpenGLES.
    How can i set to OpenGL?

    Thanks in advance,
    Peter

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

      Hi,

      Since 5.5 the backend selection is dynamic. You can however influence its behavior. See here for more information.

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

      P 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Since 5.5 the backend selection is dynamic. You can however influence its behavior. See here for more information.

        P Offline
        P Offline
        pvt.peter
        wrote on last edited by
        #3

        Hi @SGaist, thanks for your reply.

        I think i found the solution. Qt::AA_UseDesktopOpenGL and Qt::AA_ShareOpenGLContexts attributes solved my problem.

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

          Good !

          Then please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)

          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

          • Login

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