Skip to content

Commit

Permalink
Addon Manager: Add fallbacks for PySide to WidgetFilterSelector
Browse files Browse the repository at this point in the history
Ensure that this part of the Addon Manager can be tested outside
FreeCAD by falling back to explicit PySide imports.
  • Loading branch information
chennes authored and yorikvanhavre committed Dec 23, 2024
1 parent 98fbe71 commit 8edb649
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,12 @@ def translate(_: str, text: str):

# Get whatever version of PySide we can
try:
import PySide # Use the FreeCAD wrapper
from PySide import QtCore, QtWidgets # Use the FreeCAD wrapper
except ImportError:
try:
import PySide6 # Outside FreeCAD, try Qt6 first

PySide = PySide6
from PySide6 import QtCore, QtWidgets # Outside FreeCAD, try Qt6 first
except ImportError:
import PySide2 # Fall back to Qt5 (if this fails, Python will kill this module's import)

PySide = PySide2

from PySide import QtCore, QtWidgets
from PySide2 import QtCore, QtWidgets # Fall back to Qt5


class FilterType(IntEnum):
Expand Down

0 comments on commit 8edb649

Please sign in to comment.