From 93987b3703b20d48ffa52e36e14f34e7c81baf1d Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Wed, 20 Oct 2021 09:31:15 +0400 Subject: [PATCH] Fix a type mismatch --- ui/text/text_entity.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ui/text/text_entity.cpp b/ui/text/text_entity.cpp index 3136146..7a80076 100644 --- a/ui/text/text_entity.cpp +++ b/ui/text/text_entity.cpp @@ -2051,7 +2051,11 @@ QString TagWithRemoved(const QString &tag, const QString &removed) { if (tag == removed) { return QString(); } +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) auto list = QStringView(tag).split('|'); +#else // Qt >= 6.0.0 + auto list = QStringView(tag).split('|').toVector(); +#endif // Qt < 6.0.0 list.erase(ranges::remove(list, QStringView(removed)), list.end()); return JoinTag(list); } @@ -2060,7 +2064,11 @@ QString TagWithAdded(const QString &tag, const QString &added) { if (tag.isEmpty() || tag == added) { return added; } +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) auto list = QStringView(tag).split('|'); +#else // Qt >= 6.0.0 + auto list = QStringView(tag).split('|').toVector(); +#endif // Qt < 6.0.0 const auto ref = QStringView(added); if (list.contains(ref)) { return tag;