forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/3.6'
Change-Id: I4e1ec4054d7364057c63e63e293a246e64afdddb
This commit is contained in:
@@ -32,6 +32,10 @@
|
||||
#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;
|
||||
|
||||
@@ -87,8 +91,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);
|
||||
|
||||
Reference in New Issue
Block a user