diff options
Diffstat (limited to 'src/charts/chartpresenter.cpp')
-rw-r--r-- | src/charts/chartpresenter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/charts/chartpresenter.cpp b/src/charts/chartpresenter.cpp index 4ba3e13d..6316e716 100644 --- a/src/charts/chartpresenter.cpp +++ b/src/charts/chartpresenter.cpp @@ -41,6 +41,7 @@ #include <private/cartesianchartlayout_p.h> #include <private/polarchartlayout_p.h> #include <private/charttitle_p.h> +#include <QtCore/QRegularExpression> #include <QtCore/QTimer> #include <QtGui/QTextDocument> #include <QtWidgets/QGraphicsScene> @@ -486,7 +487,7 @@ QString ChartPresenter::truncatedText(const QFont &font, const QString &text, qr // It can be assumed that almost any amount of string manipulation is faster // than calculating one bounding rectangle, so first prepare a list of truncated strings // to try. - static QRegExp truncateMatcher(QStringLiteral("&#?[0-9a-zA-Z]*;$")); + static QRegularExpression truncateMatcher(QStringLiteral("&#?[0-9a-zA-Z]*;$")); QVector<QString> testStrings(text.length()); int count(0); @@ -502,7 +503,7 @@ QString ChartPresenter::truncatedText(const QFont &font, const QString &text, qr if (lastChar == closeTag) chopIndex = truncatedString.lastIndexOf(openTag); else if (lastChar == semiColon) - chopIndex = truncateMatcher.indexIn(truncatedString, 0); + chopIndex = truncatedString.indexOf(truncateMatcher); if (chopIndex != -1) chopCount = truncatedString.length() - chopIndex; |