diff options
author | Jonas Karlsson <jonas.karlsson@qt.io> | 2020-08-21 13:01:43 +0200 |
---|---|---|
committer | Jonas Karlsson <jonas.karlsson@qt.io> | 2020-08-28 07:27:27 +0200 |
commit | 174154bcac2780cb704011662f2e9c1233fec933 (patch) | |
tree | a93dff334e4b2f47d12662b1967af0a8307c40b9 | |
parent | 3558704ed5c3d2c6dc6d024dfa454997469ca75f (diff) |
Remove "internal" parameter in QTextLine::draw()
The method is split up into a private and public version, where the
parameter is moved into the private method.
Fixes: QTBUG-84210
Change-Id: I79e9e02c9b4cc25d31db066e5a9567fdb9bc9fd0
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 15 | ||||
-rw-r--r-- | src/gui/text/qtextlayout.h | 4 |
2 files changed, 13 insertions, 6 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index cd064364d5..35dbf677a3 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -1184,7 +1184,7 @@ void QTextLayout::draw(QPainter *p, const QPointF &pos, const QList<FormatRange> for (int line = firstLine; line < lastLine; ++line) { QTextLine l(line, d); - l.draw(p, position, &selection); + l.draw_internal(p, position, &selection); } p->restore(); @@ -1208,7 +1208,7 @@ void QTextLayout::draw(QPainter *p, const QPointF &pos, const QList<FormatRange> selection.format.setProperty(SuppressBackground, true); for (int line = firstLine; line < lastLine; ++line) { QTextLine l(line, d); - l.draw(p, position, &selection); + l.draw_internal(p, position, &selection); } p->restore(); } @@ -2473,12 +2473,17 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const #endif // QT_NO_RAWFONT /*! - \fn void QTextLine::draw(QPainter *painter, const QPointF &position, const QTextLayout::FormatRange *selection) const + \fn void QTextLine::draw(QPainter *painter, const QPointF &position) const Draws a line on the given \a painter at the specified \a position. - The \a selection is reserved for internal use. */ -void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatRange *selection) const +void QTextLine::draw(QPainter *painter, const QPointF &position) const +{ + draw_internal(painter, position, nullptr); +} + +void QTextLine::draw_internal(QPainter *p, const QPointF &pos, + const QTextLayout::FormatRange *selection) const { #ifndef QT_NO_RAWFONT // Not intended to work with rawfont diff --git a/src/gui/text/qtextlayout.h b/src/gui/text/qtextlayout.h index cf3b4bb869..16dde50f05 100644 --- a/src/gui/text/qtextlayout.h +++ b/src/gui/text/qtextlayout.h @@ -264,7 +264,7 @@ public: int lineNumber() const { return index; } - void draw(QPainter *p, const QPointF &point, const QTextLayout::FormatRange *selection = nullptr) const; + void draw(QPainter *painter, const QPointF &position) const; #if !defined(QT_NO_RAWFONT) QList<QGlyphRun> glyphRuns(int from = -1, int length = -1) const; @@ -273,6 +273,8 @@ public: private: QTextLine(int line, QTextEngine *e) : index(line), eng(e) {} void layout_helper(int numGlyphs); + void draw_internal(QPainter *p, const QPointF &pos, + const QTextLayout::FormatRange *selection) const; friend class QTextLayout; friend class QTextFragment; |