Skip to content

Commit f2f20fa

Browse files
authored
Merge pull request #10613 from gadfort/gui-fix-regex
gui: ensure QT5 and QT6 behave the same
2 parents 5993f6e + b6727fc commit f2f20fa

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/gui/src/displayControls.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1251,8 +1251,13 @@ void DisplayControls::findControlsInItems(const std::string& path,
12511251
collectControls(model_->invisibleRootItem(), column, controls);
12521252

12531253
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
1254+
// NonPathWildcardConversion makes '*' match across '/' (like the old
1255+
// QRegExp::Wildcard); the default path mode would translate '*' to "[^/]*",
1256+
// so a bare '*' would fail to match any control path containing a separator.
12541257
QString regexPattern = QRegularExpression::wildcardToRegularExpression(
1255-
QString::fromStdString(path)); // Defaults to exact match.
1258+
QString::fromStdString(path),
1259+
QRegularExpression::NonPathWildcardConversion); // Defaults to exact
1260+
// match.
12561261

12571262
// Create the QRegularExpression object with the case-insensitive option.
12581263
const QRegularExpression path_compare(

0 commit comments

Comments
 (0)