From 118d1eee16846293cce3d91edc8cb0c1e603cab2 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Mon, 16 Jan 2023 11:24:38 +0100 Subject: [PATCH] Fix 'QRegExpValidator' vs. 'QRegularExpressionValidator' --- openpype/tools/creator/widgets.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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)