aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tagwidget.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-10-26 07:27:47 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-10-26 19:27:03 -0700
commitffecc00f42f2e02f76cf616d03d179e8741f4fba (patch)
tree43cca48ab6f8f64bcf0e6ecfce7164f1ffa32229 /desktop-widgets/tagwidget.cpp
parentf8f83a9986917de1f879abd474330812c4a1e51a (diff)
downloadsubsurface-ffecc00f42f2e02f76cf616d03d179e8741f4fba.tar.gz
cleanup: SkipEmptyParts syntax has changed
Sadly, the new enum has only been available since Qt 5.14, so this is a rather ugly replacement. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/tagwidget.cpp')
-rw-r--r--desktop-widgets/tagwidget.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/desktop-widgets/tagwidget.cpp b/desktop-widgets/tagwidget.cpp
index 5327b0a2c..01ddd15be 100644
--- a/desktop-widgets/tagwidget.cpp
+++ b/desktop-widgets/tagwidget.cpp
@@ -39,6 +39,12 @@ void TagWidget::setCompleter(QCompleter *completer)
connect(m_completer, SIGNAL(highlighted(QString)), this, SLOT(completionHighlighted(QString)));
}
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
+#define SKIP_EMPTY Qt::SkipEmptyParts
+#else
+#define SKIP_EMPTY QString::SkipEmptyParts
+#endif
+
QPair<int, int> TagWidget::getCursorTagPosition()
{
int i = 0, start = 0, end = 0;
@@ -71,7 +77,7 @@ void TagWidget::highlight()
{
removeAllBlocks();
int lastPos = 0;
- const auto l = text().split(QChar(','), QString::SkipEmptyParts);
+ const auto l = text().split(QChar(','), SKIP_EMPTY);
for (const QString &s: l) {
QString trimmed = s.trimmed();
if (trimmed.isEmpty())