diff --git a/openpype/tools/creator/widgets.py b/openpype/tools/creator/widgets.py index 8ea3cbd03f..8269cee42c 100644 --- a/openpype/tools/creator/widgets.py +++ b/openpype/tools/creator/widgets.py @@ -8,6 +8,11 @@ import qtawesome from openpype.pipeline.create import SUBSET_NAME_ALLOWED_SYMBOLS from openpype.tools.utils import ErrorMessageBox +if hasattr(QtGui, "QRegularExpressionValidator"): + RegExpValidatorClass = QtGui.QRegularExpressionValidator +else: + RegExpValidatorClass = QtGui.QRegExpValidator + class CreateErrorMessageBox(ErrorMessageBox): def __init__( @@ -82,7 +87,7 @@ class CreateErrorMessageBox(ErrorMessageBox): content_layout.addWidget(tb_widget) -class SubsetNameValidator(QtGui.QRegExpValidator): +class SubsetNameValidator(RegExpValidatorClass): invalid = QtCore.Signal(set) pattern = "^[{}]*$".format(SUBSET_NAME_ALLOWED_SYMBOLS)