Skip to content

Commit ec31e18

Browse files
authored
Quick and dirty fix for #207
Move away from the deprecated QGLWidget and replace it with QOpenGLWidget This fixes the Wayland OpenGL issues described in #207 (in a very rough way)
1 parent 9dae5a0 commit ec31e18

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

NodeGraphQt/widgets/viewer.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
# -*- coding: utf-8 -*-
33
import math
44

5-
from Qt import QtGui, QtCore, QtWidgets, QtOpenGL
5+
from Qt import QtGui, QtCore, QtWidgets
6+
7+
try:
8+
from PySide2.QtWidgets import QOpenGLWidget
9+
except Exception:
10+
from PyQt5.QtWidgets import QOpenGLWidget
611

712
from .dialogs import BaseDialog, FileDialog
813
from .scene import NodeScene
@@ -1150,6 +1155,4 @@ def clear_key_state(self):
11501155
self.ALT_state = False
11511156

11521157
def use_OpenGL(self):
1153-
format = QtOpenGL.QGLFormat(QtOpenGL.QGL.SampleBuffers)
1154-
format.setSamples(4)
1155-
self.setViewport(QtOpenGL.QGLWidget(format))
1158+
self.setViewport(QOpenGLWidget())

0 commit comments

Comments
 (0)