diff options
-rw-r--r-- | doc/src/snippets/code/src_gui_text_qtextlayout.cpp | 2 | ||||
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/doc/src/snippets/code/src_gui_text_qtextlayout.cpp b/doc/src/snippets/code/src_gui_text_qtextlayout.cpp index ad5725e..13040ea 100644 --- a/doc/src/snippets/code/src_gui_text_qtextlayout.cpp +++ b/doc/src/snippets/code/src_gui_text_qtextlayout.cpp @@ -42,7 +42,6 @@ //! [0] int leading = fontMetrics.leading(); qreal height = 0; -qreal widthUsed = 0; textLayout.beginLayout(); while (1) { QTextLine line = textLayout.createLine(); @@ -53,7 +52,6 @@ while (1) { height += leading; line.setPosition(QPointF(0, height)); height += line.height(); - widthUsed = qMax(widthUsed, line.naturalTextWidth()); } textLayout.endLayout(); //! [0] diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 312d135..ce7915d 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -305,7 +305,7 @@ Qt::LayoutDirection QTextInlineObject::textDirection() const Once the layout is done, these lines can be drawn on a paint device. - Here's some pseudo code that presents the layout phase: + Here's some code snippet that presents the layout phase: \snippet doc/src/snippets/code/src_gui_text_qtextlayout.cpp 0 The text can be drawn by calling the layout's draw() function: |