diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2014-02-21 15:15:29 +0100 |
---|---|---|
committer | Konstantin Ritt <ritt.ks@gmail.com> | 2015-05-30 10:56:24 +0000 |
commit | 87d57d19941fba4a921020480ca5761f23536c93 (patch) | |
tree | 9157982715d32e8a9c014fbdc104d9721aac525f /src/widgets/widgets | |
parent | 9eff0dd19d6507ec400f036dd27efe960e4e5f78 (diff) |
Fix users of QTextLayout::additionalFormats to use the new API
QTextLayout::additionalFormats setters and getters using QList<FormatRange> have
been deprecated; port to the QVector versions.
Moved op== definition for FormatRange needed in tst_qsyntaxhighlighter.cpp
to a friend declaration in FormatRange itself, because MSVC 2008 doesn't find
it otherwise.
Change-Id: Ibab6589df057f02377d895079b56395859e3401e
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r-- | src/widgets/widgets/qwidgetlinecontrol.cpp | 6 | ||||
-rw-r--r-- | src/widgets/widgets/qwidgettextcontrol.cpp | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index 759e41a5fa..3cd0277f77 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -189,7 +189,7 @@ void QWidgetLineControl::commitPreedit() m_preeditCursor = 0; setPreeditArea(-1, QString()); - m_textLayout.clearAdditionalFormats(); + m_textLayout.clearFormats(); updateDisplayText(/*force*/ true); #endif } @@ -557,7 +557,7 @@ void QWidgetLineControl::processInputMethodEvent(QInputMethodEvent *event) const int oldPreeditCursor = m_preeditCursor; m_preeditCursor = event->preeditString().length(); m_hideCursor = false; - QList<QTextLayout::FormatRange> formats; + QVector<QTextLayout::FormatRange> formats; for (int i = 0; i < event->attributes().size(); ++i) { const QInputMethodEvent::Attribute &a = event->attributes().at(i); if (a.type == QInputMethodEvent::Cursor) { @@ -574,7 +574,7 @@ void QWidgetLineControl::processInputMethodEvent(QInputMethodEvent *event) } } } - m_textLayout.setAdditionalFormats(formats); + m_textLayout.setFormats(formats); updateDisplayText(/*force*/ true); if (cursorPositionChanged) emitCursorPositionChanged(); diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index 53b2406fc1..a46abf374d 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -2029,7 +2029,7 @@ void QWidgetTextControlPrivate::inputMethodEvent(QInputMethodEvent *e) QTextLayout *layout = block.layout(); if (isGettingInput) layout->setPreeditArea(cursor.position() - block.position(), e->preeditString()); - QList<QTextLayout::FormatRange> overrides; + QVector<QTextLayout::FormatRange> overrides; const int oldPreeditCursor = preeditCursor; preeditCursor = e->preeditString().length(); hideCursor = false; @@ -2049,7 +2049,7 @@ void QWidgetTextControlPrivate::inputMethodEvent(QInputMethodEvent *e) } } } - layout->setAdditionalFormats(overrides); + layout->setFormats(overrides); cursor.endEditBlock(); @@ -2878,7 +2878,7 @@ void QWidgetTextControlPrivate::commitPreedit() QTextBlock block = cursor.block(); QTextLayout *layout = block.layout(); layout->setPreeditArea(-1, QString()); - layout->clearAdditionalFormats(); + layout->clearFormats(); cursor.endEditBlock(); } |