diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2015-10-29 10:08:29 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2016-01-22 23:45:08 +0000 |
commit | f443c95dcc49f0846fc2bee5bd2ccbcac4e4b1d5 (patch) | |
tree | d8867233616b2d7760f1d68e95dc2d5bf5db55dd | |
parent | fea48a1e0de87692000d2e82dc20cb3c490138e4 (diff) | |
download | qt-creator-f443c95dcc49f0846fc2bee5bd2ccbcac4e4b1d5.tar.gz |
Adapt to QtGui changes that broke private API source compatibility
The public constructors in QTextCursor that were private API are no
longer public.
Task-number: QTCREATORBUG-15238
Change-Id: I3bc59670b62d4afaa645ffff1411b76029249840
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
-rw-r--r-- | src/plugins/coreplugin/coreplugin.pro | 3 | ||||
-rw-r--r-- | src/plugins/coreplugin/find/basetextfind.cpp | 7 | ||||
-rw-r--r-- | src/plugins/texteditor/texteditor.pro | 2 | ||||
-rw-r--r-- | src/plugins/texteditor/texteditoroverlay.cpp | 7 |
4 files changed, 17 insertions, 2 deletions
diff --git a/src/plugins/coreplugin/coreplugin.pro b/src/plugins/coreplugin/coreplugin.pro index de9318feaa..91fdff0816 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 564df8ead1..9630dd53fa 100644 --- a/src/plugins/coreplugin/find/basetextfind.cpp +++ b/src/plugins/coreplugin/find/basetextfind.cpp @@ -39,6 +39,8 @@ #include <QPlainTextEdit> #include <QTextCursor> +#include <private/qtextcursor_p.h> + 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 a4f47b2500..e12f96e454 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 025b320638..295d9a66b4 100644 --- a/src/plugins/texteditor/texteditoroverlay.cpp +++ b/src/plugins/texteditor/texteditoroverlay.cpp @@ -37,6 +37,8 @@ #include <QPainter> #include <QTextBlock> +#include <private/qtextcursor_p.h> + 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); |