summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjk <hjk@theqtcompany.com>2016-01-29 11:00:56 +0100
committerhjk <hjk@theqtcompany.com>2016-01-29 12:46:13 +0000
commit6844d3f277e773441e78eb1d44c2b51b53507ece (patch)
tree81139ff0a2a75ec5b6ce859134ecf51b011561f6
parentf64d7e6ad403f7223e0aa693f26ca2792895a780 (diff)
downloadqt-creator-6844d3f277e773441e78eb1d44c2b51b53507ece.tar.gz
Find: Remove use of unsual QTextCursor constructors
Change-Id: If3b86d49c5b87974f7d40fcfa75e4a303ba55c1a Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com> (cherry picked from commit 1edd6193ba1bdf39c70e071bc267960b6387863e)
-rw-r--r--src/plugins/coreplugin/find/basetextfind.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/plugins/coreplugin/find/basetextfind.cpp b/src/plugins/coreplugin/find/basetextfind.cpp
index f331d6206a..2c08e6cfd0 100644
--- a/src/plugins/coreplugin/find/basetextfind.cpp
+++ b/src/plugins/coreplugin/find/basetextfind.cpp
@@ -39,10 +39,6 @@
#include <QPlainTextEdit>
#include <QTextCursor>
-#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
-#include <private/qtextcursor_p.h>
-#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;