PySide6 Handle QRegExp case sensitivity, FixedString, and Wildcard pattern syntaxes #1075
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ISSUE: The current tk_core releases do not properly handle case sensitivity in the way apps intend in PySide6. Eg. tk-multi-workfiles2 uses
QtCore.Qt.CaseInsensitiveto flag that a QRegExp should be case insensitivehttps://github.com/shotgunsoftware/tk-multi-workfiles2/blob/3e56df0ce651a814e19fc221a3eda09964a4311e/python/tk_multi_workfiles/entity_tree/entity_tree_form.py#L531
SOLUTION: Recognise
QtCore.Qt.CaseInsensitivein the QRegExp to QRegularExpression patcher. Also add pattern syntax handling ofFixedStringusingQRegularExpression.escape()to properly match plain strings andWildcardusingQRegularExpression.wildcardToRegularExpressionto properly expand wildcardsininit`.These changes were made as part of my work at Flying Bark Productions, which my leadership @diegogarciahuerta has generously allowed me to contribute here.