diff --git a/src/plugins/coreplugin/coreplugin.pro b/src/plugins/coreplugin/coreplugin.pro index de9318feaad..91fdff08167 100644 --- a/src/plugins/coreplugin/coreplugin.pro +++ b/src/plugins/coreplugin/coreplugin.pro @@ -1,5 +1,6 @@ DEFINES += CORE_LIBRARY -QT += help \ +QT += gui-private \ + help \ network \ printsupport \ qml \ diff --git a/src/plugins/coreplugin/find/basetextfind.cpp b/src/plugins/coreplugin/find/basetextfind.cpp index 564df8ead19..9630dd53fae 100644 --- a/src/plugins/coreplugin/find/basetextfind.cpp +++ b/src/plugins/coreplugin/find/basetextfind.cpp @@ -39,6 +39,8 @@ #include #include +#include + namespace Core { struct BaseTextFindPrivate @@ -392,8 +394,13 @@ 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_findScopeVerticalBlockSelectionFirstColumn = -1; d->m_findScopeVerticalBlockSelectionLastColumn = -1; diff --git a/src/plugins/texteditor/texteditor.pro b/src/plugins/texteditor/texteditor.pro index a4f47b2500d..e12f96e454d 100644 --- a/src/plugins/texteditor/texteditor.pro +++ b/src/plugins/texteditor/texteditor.pro @@ -1,5 +1,5 @@ DEFINES += TEXTEDITOR_LIBRARY -QT += network printsupport xml +QT += gui-private network printsupport xml CONFIG += exceptions CONFIG += include_source_dir # For the highlighter autotest. include(../../qtcreatorplugin.pri) diff --git a/src/plugins/texteditor/texteditoroverlay.cpp b/src/plugins/texteditor/texteditoroverlay.cpp index 025b3206386..295d9a66b49 100644 --- a/src/plugins/texteditor/texteditoroverlay.cpp +++ b/src/plugins/texteditor/texteditoroverlay.cpp @@ -37,6 +37,8 @@ #include #include +#include + using namespace TextEditor; using namespace TextEditor::Internal; @@ -92,8 +94,13 @@ void TextEditorOverlay::addOverlaySelection(int begin, int end, selection.m_fg = fg; selection.m_bg = bg; +#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) + selection.m_cursor_begin = QTextCursorPrivate::fromPosition(document->docHandle(), begin); + selection.m_cursor_end = QTextCursorPrivate::fromPosition(document->docHandle(), end); +#else selection.m_cursor_begin = QTextCursor(document->docHandle(), begin); selection.m_cursor_end = QTextCursor(document->docHandle(), end); +#endif if (overlaySelectionFlags & ExpandBegin) selection.m_cursor_begin.setKeepPositionOnInsert(true);