Skip to content

About the OpenGL module in Qt #241

@wangdaye078

Description

@wangdaye078

Starting from Qt6.0, classes QOpenGLXXXX (such as QOpenGLBuffer) have been migrated to the QtOpenGL module.
Therefore, the
<object type name="QOpenGLBuffer"/>
in typesystem_gui.xml should be changed to
<object type name="QOpenGLBuffer" before-version="6"/>,
and then
<object type name="QOpenGLBuffer" since-version="6"/>
should be added to typesystem_opengl.xml. Other QOpenGLXXXXs should also be treated similarly,
while the original QGLBuffer in typesystem_opengl.xml should be changed to
<object type name="QGLBuffer Before-version=" 6 "/>

int PythonQt_QtAll.pro

  lessThan(QT_MAJOR_VERSION, 6) {
    # module is empty in Qt6
    qtHaveModule(opengl):CONFIG += PythonQtOpengl
  }

changto:
qtHaveModule(opengl):CONFIG += PythonQtOpengl

PythonQtOpengl {
  DEFINES += PYTHONQT_WITH_OPENGL
  QT += opengl
  PythonQtCore: Xinclude (com_trolltech_qt_opengl)
  QT += xml
}

changto:

PythonQtOpengl {
  DEFINES += PYTHONQT_WITH_OPENGL
  QT += opengl
  equals(QT_MAJOR_VERSION, 6){
    QT += openglwidgets
  }
  PythonQtCore: Xinclude (com_trolltech_qt_opengl)
  QT += xml
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions