diff options
Diffstat (limited to 'src/gui/text/qtextlayout.h')
-rw-r--r-- | src/gui/text/qtextlayout.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/gui/text/qtextlayout.h b/src/gui/text/qtextlayout.h index 47dcd388e2..f74d4d4229 100644 --- a/src/gui/text/qtextlayout.h +++ b/src/gui/text/qtextlayout.h @@ -62,7 +62,7 @@ class Q_GUI_EXPORT QTextInlineObject { public: QTextInlineObject(int i, QTextEngine *e) : itm(i), eng(e) {} - inline QTextInlineObject() : itm(0), eng(0) {} + inline QTextInlineObject() : itm(0), eng(Q_NULLPTR) {} inline bool isValid() const { return eng; } QRectF rect() const; @@ -100,7 +100,7 @@ public: // does itemization QTextLayout(); QTextLayout(const QString& text); - QTextLayout(const QString& text, const QFont &font, QPaintDevice *paintdevice = 0); + QTextLayout(const QString& text, const QFont &font, QPaintDevice *paintdevice = Q_NULLPTR); QTextLayout(const QTextBlock &b); ~QTextLayout(); @@ -125,10 +125,20 @@ 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; - void clearAdditionalFormats(); +#if QT_DEPRECATED_SINCE(5, 6) + QT_DEPRECATED_X("Use setFormats()") void setAdditionalFormats(const QList<FormatRange> &overrides); + QT_DEPRECATED_X("Use formats()") QList<FormatRange> additionalFormats() const; + QT_DEPRECATED_X("Use clearFormats()") void clearAdditionalFormats(); +#endif + void setFormats(const QVector<FormatRange> &overrides); + QVector<FormatRange> formats() const; + void clearFormats(); void setCacheEnabled(bool enable); bool cacheEnabled() const; @@ -192,7 +202,7 @@ private: class Q_GUI_EXPORT QTextLine { public: - inline QTextLine() : index(0), eng(0) {} + inline QTextLine() : index(0), eng(Q_NULLPTR) {} inline bool isValid() const { return eng; } QRectF rect() const; @@ -237,7 +247,7 @@ public: int lineNumber() const { return index; } - void draw(QPainter *p, const QPointF &point, const QTextLayout::FormatRange *selection = 0) const; + void draw(QPainter *p, const QPointF &point, const QTextLayout::FormatRange *selection = Q_NULLPTR) const; #if !defined(QT_NO_RAWFONT) QList<QGlyphRun> glyphRuns(int from = -1, int length = -1) const; |