diff --git a/src/items/text/KReportItemText.cpp b/src/items/text/KReportItemText.cpp --- a/src/items/text/KReportItemText.cpp +++ b/src/items/text/KReportItemText.cpp @@ -26,6 +26,7 @@ #include #include #include +#include KReportItemText::KReportItemText() : KReportItemText(QDomNode()) @@ -225,7 +226,7 @@ int pos = 0; QChar separator; - QRegExp re(QLatin1String("\\s")); + QRegularExpression re(QLatin1String("\\s")); QPrinter prnt(QPrinter::HighResolution); QFontMetrics fm(font(), &prnt); @@ -236,7 +237,8 @@ qreal intRectHeight = trf.height(); while (qstrValue.length()) { - int idx = re.indexIn(qstrValue, pos); + QRegularExpressionMatch match = re.match(qstrValue); + int idx = match.capturedStart(pos); if (idx == -1) { idx = qstrValue.length(); separator = QLatin1Char('\n');