Skip to content

Commit 63ea968

Browse files
authored
Merge pull request jchanvfx#209 from mara004/master
Quick fix for jchanvfx#207
2 parents 9dae5a0 + ba6edeb commit 63ea968

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

NodeGraphQt/widgets/viewer.py

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

5-
from Qt import QtGui, QtCore, QtWidgets, QtOpenGL
5+
import Qt
6+
from Qt import QtGui, QtCore, QtWidgets
7+
8+
# use QOpenGLWidget instead of the deprecated QGLWidget to avoid probelms with Wayland
9+
if Qt.IsPySide2:
10+
from PySide2.QtWidgets import QOpenGLWidget
11+
elif Qt.IsPyQt5:
12+
from PyQt5.QtWidgets import QOpenGLWidget
613

714
from .dialogs import BaseDialog, FileDialog
815
from .scene import NodeScene
@@ -1150,6 +1157,4 @@ def clear_key_state(self):
11501157
self.ALT_state = False
11511158

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

0 commit comments

Comments
 (0)