Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to test workstation OpenGL version with QSurfaceFormat?
Qt 6.12 LTS is out! See what's new in the release blog

How to test workstation OpenGL version with QSurfaceFormat?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qglformatqsurfaceformat
2 Posts 2 Posters 1.5k 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
    Alchete
    wrote on last edited by
    #1

    Our app runs across a variety of different workstations, some without proper graphics drivers installed, so I need to check the workstation opengl version before drawing anything.

    In Qt 5.2, I had been using the following:

    QGLFormat::openGLVersionFlags().testFlag(flag)))
    

    However, QGLFormat has been deprecated moving forward.

    I'm probably missing something obvious, but in Qt 5.6 there doesn't appear to be an equivalent one-line check using QOpenGLWidget/QSurfaceFormat...

    What's the recommended method to test how high an opengl level the workstation supports using QOpenGLWidget/QSurfaceFormat?

    Thanks :)

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Rob P
      wrote on last edited by
      #2
      QSurfaceFormat fmt(this->format());
      cout << fmt.majorVersion() << "." << fmt.minorVersion() << endl;
      
      1 Reply Last reply
      1

      • Login

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