Merge remote-tracking branch 'origin/3.6'

Change-Id: Iba662995e76f1b6ec135d64072a36a2498b2b5bb
This commit is contained in:
Eike Ziller
2016-02-03 10:55:38 +01:00
5 changed files with 24 additions and 18 deletions

View File

@@ -32,10 +32,6 @@
#include <QPainter>
#include <QTextBlock>
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
#include <private/qtextcursor_p.h>
#endif
using namespace TextEditor;
using namespace TextEditor::Internal;
@@ -91,13 +87,10 @@ 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
selection.m_cursor_begin = QTextCursor(document);
selection.m_cursor_begin.setPosition(begin);
selection.m_cursor_end = QTextCursor(document);
selection.m_cursor_end.setPosition(end);
if (overlaySelectionFlags & ExpandBegin)
selection.m_cursor_begin.setKeepPositionOnInsert(true);