[LyX/master] Fix TOC filtering with slashes (#12359)

Juergen Spitzmueller spitz at lyx.org
Wed Dec 29 13:15:57 UTC 2021


commit 0f2d711f34da8f3e573d96a87fc31095651c28b7
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Wed Dec 29 14:43:52 2021 +0100

    Fix TOC filtering with slashes (#12359)
    
    Seems the * wildcard does not match these.
---
 src/frontends/qt/TocWidget.cpp |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/frontends/qt/TocWidget.cpp b/src/frontends/qt/TocWidget.cpp
index cd346a8..483f008 100644
--- a/src/frontends/qt/TocWidget.cpp
+++ b/src/frontends/qt/TocWidget.cpp
@@ -523,8 +523,13 @@ void TocWidget::filterContents()
 
 	QModelIndexList indices = tocTV->model()->match(
 		tocTV->model()->index(0, 0),
-		Qt::DisplayRole, "*", -1,
-		Qt::MatchFlags(Qt::MatchWildcard|Qt::MatchRecursive));
+		Qt::DisplayRole, ".*", -1,
+#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
+		Qt::MatchFlags(Qt::MatchRegularExpression|Qt::MatchRecursive));
+#else
+		// deprecated in Qt 5.15.
+		Qt::MatchFlags(Qt::MatchRegExp|Qt::MatchRecursive));
+#endif
 
 	bool const show_active =
 		activeFilterCO->currentIndex() != 2;


More information about the lyx-cvs mailing list