summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextlayout.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-02-21 15:15:29 +0100
committerKonstantin Ritt <ritt.ks@gmail.com>2015-05-30 10:56:24 +0000
commit87d57d19941fba4a921020480ca5761f23536c93 (patch)
tree9157982715d32e8a9c014fbdc104d9721aac525f /src/gui/text/qtextlayout.h
parent9eff0dd19d6507ec400f036dd27efe960e4e5f78 (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/gui/text/qtextlayout.h')
-rw-r--r--src/gui/text/qtextlayout.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/text/qtextlayout.h b/src/gui/text/qtextlayout.h
index ce092e0928..9709af4fd1 100644
--- a/src/gui/text/qtextlayout.h
+++ b/src/gui/text/qtextlayout.h
@@ -125,6 +125,11 @@ public:
int start;
int length;
QTextCharFormat format;
+
+ friend bool operator==(const FormatRange &lhs, const FormatRange &rhs)
+ { return lhs.start == rhs.start && lhs.length == rhs.length && lhs.format == rhs.format; }
+ friend bool operator!=(const FormatRange &lhs, const FormatRange &rhs)
+ { return !operator==(lhs, rhs); }
};
void setAdditionalFormats(const QList<FormatRange> &overrides);
QList<FormatRange> additionalFormats() const;