Skip to content

Commit 5a1c1e7

Browse files
authored
Improve import
Use Qt.IsPySide2 / Qt.IsPyQt5 rather than try/except
1 parent ec31e18 commit 5a1c1e7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

NodeGraphQt/widgets/viewer.py

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

5+
import Qt
56
from Qt import QtGui, QtCore, QtWidgets
67

7-
try:
8+
# use QOpenGLWidget instead of the deprecated QGLWdiegt to avoid probelms with Wayland
9+
if Qt.IsPySide2:
810
from PySide2.QtWidgets import QOpenGLWidget
9-
except Exception:
11+
elif Qt.IsPyQt5:
1012
from PyQt5.QtWidgets import QOpenGLWidget
1113

1214
from .dialogs import BaseDialog, FileDialog

0 commit comments

Comments
 (0)