Addon Manager: Qt6 migration part 1, use PySide

Migrate all uses of "import PySide 2" to use "import PySide" so that the
FreeCAD-provided wrappers can switch between Qt versions.
This commit is contained in:
Chris Hennes
2022-11-04 22:37:59 -05:00
committed by wwmayer
parent 06922ae093
commit b407332475
22 changed files with 56 additions and 58 deletions

View File

@@ -24,24 +24,24 @@
import keyword
from PySide2.QtGui import (
from PySide.QtGui import (
QValidator,
)
# QRegularExpressionValidator was only added at the very end of the PySide2
# QRegularExpressionValidator was only added at the very end of the PySide
# development cycle, so make sure to support the older QRegExp version as well.
try:
from PySide2.QtGui import (
from PySide.QtGui import (
QRegularExpressionValidator,
)
from PySide2.QtCore import QRegularExpression
from PySide.QtCore import QRegularExpression
RegexWrapper = QRegularExpression
RegexValidatorWrapper = QRegularExpressionValidator
except ImportError:
from PySide2.QtGui import (
from PySide.QtGui import (
QRegExpValidator,
)
from PySide2.QtCore import QRegExp
from PySide.QtCore import QRegExp
RegexWrapper = QRegExp
RegexValidatorWrapper = QRegExpValidator