diff --git a/src/plugins/coreplugin/find/basetextfind.cpp b/src/plugins/coreplugin/find/basetextfind.cpp index f331d6206a4..2c08e6cfd03 100644 --- a/src/plugins/coreplugin/find/basetextfind.cpp +++ b/src/plugins/coreplugin/find/basetextfind.cpp @@ -39,10 +39,6 @@ #include #include -#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) -#include -#endif - namespace Core { struct BaseTextFindPrivate @@ -396,13 +392,10 @@ void BaseTextFind::defineFindScope() { QTextCursor cursor = textCursor(); if (cursor.hasSelection() && cursor.block() != cursor.document()->findBlock(cursor.anchor())) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) - d->m_findScopeStart = QTextCursorPrivate::fromPosition(document()->docHandle(), qMax(0, cursor.selectionStart())); - d->m_findScopeEnd = QTextCursorPrivate::fromPosition(document()->docHandle(), cursor.selectionEnd()); -#else - d->m_findScopeStart = QTextCursor(document()->docHandle(), qMax(0, cursor.selectionStart())); - d->m_findScopeEnd = QTextCursor(document()->docHandle(), cursor.selectionEnd()); -#endif + d->m_findScopeStart = cursor; + d->m_findScopeStart.setPosition(qMax(0, cursor.selectionStart())); + d->m_findScopeEnd = cursor; + d->m_findScopeEnd.setPosition(cursor.selectionEnd()); d->m_findScopeVerticalBlockSelectionFirstColumn = -1; d->m_findScopeVerticalBlockSelectionLastColumn = -1;