diff --git a/src/qcodeedit/lib/document/qdocumentsearch.cpp b/src/qcodeedit/lib/document/qdocumentsearch.cpp index d2cd750ebd..c4952e46e3 100644 --- a/src/qcodeedit/lib/document/qdocumentsearch.cpp +++ b/src/qcodeedit/lib/document/qdocumentsearch.cpp @@ -678,7 +678,7 @@ int QDocumentSearch::next(bool backward, bool all, bool again, bool allowWrapAro const QDocumentLine& l = m_cursor.line(); int coloffset = 0; - QString s = l.text(); + s = l.text(); if ( bounded ) { // update boundaries as scope is changed when changing text diff --git a/src/qcodeedit/lib/document/qdocumentsearch.h b/src/qcodeedit/lib/document/qdocumentsearch.h index 4195d52fcc..d81c9bc623 100644 --- a/src/qcodeedit/lib/document/qdocumentsearch.h +++ b/src/qcodeedit/lib/document/qdocumentsearch.h @@ -106,6 +106,7 @@ class QCE_EXPORT QDocumentSearch: public QObject Options m_option; QString m_string; + QString s; // keep string alive so that corresponding match may refer it, seems to be changed in Qt5.3 QRegularExpression m_regularExpression; QRegularExpressionMatch m_match;