forked from qt-creator/qt-creator
TextEditor: Revert adaptation to reverted QTextCursor API change.
Change-Id: I1f778f6389adc6937330b727006ad89880328cb5 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -37,10 +37,6 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QTextBlock>
|
#include <QTextBlock>
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
|
|
||||||
#include <private/qtextcursor_p.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace TextEditor;
|
using namespace TextEditor;
|
||||||
using namespace TextEditor::Internal;
|
using namespace TextEditor::Internal;
|
||||||
|
|
||||||
@@ -96,13 +92,8 @@ void TextEditorOverlay::addOverlaySelection(int begin, int end,
|
|||||||
selection.m_fg = fg;
|
selection.m_fg = fg;
|
||||||
selection.m_bg = bg;
|
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_begin = QTextCursor(document->docHandle(), begin);
|
||||||
selection.m_cursor_end = QTextCursor(document->docHandle(), end);
|
selection.m_cursor_end = QTextCursor(document->docHandle(), end);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (overlaySelectionFlags & ExpandBegin)
|
if (overlaySelectionFlags & ExpandBegin)
|
||||||
selection.m_cursor_begin.setKeepPositionOnInsert(true);
|
selection.m_cursor_begin.setKeepPositionOnInsert(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user