From 1dc1a032a84d1cc408623ba5b77a0acf50a58eea Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Tue, 21 May 2019 22:02:56 +0200 Subject: doc: Improve the Coordinate System rectangle coordinate examples QRect and QLine share a constructor with the same signature but with different meanings. This patch improves the coordinate examples to show the possibilities and make things clearer. Change-Id: I76a95ca226c12968ae5b15d4eb12fc2965cb57d2 Reviewed-by: Paul Wicking Reviewed-by: Luca Beldi Reviewed-by: Sze Howe Koh --- src/gui/doc/snippets/code/doc_src_coordsys.cpp | 2 ++ src/gui/doc/src/coordsys.qdoc | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src/gui/doc') diff --git a/src/gui/doc/snippets/code/doc_src_coordsys.cpp b/src/gui/doc/snippets/code/doc_src_coordsys.cpp index 7c53d9e731..147c146b44 100644 --- a/src/gui/doc/snippets/code/doc_src_coordsys.cpp +++ b/src/gui/doc/snippets/code/doc_src_coordsys.cpp @@ -52,6 +52,7 @@ QPainter painter(this); painter.setPen(Qt::darkGreen); +// Using the (x y w h) overload painter.drawRect(1, 2, 6, 4); //! [0] @@ -69,6 +70,7 @@ QPainter painter(this); painter.setRenderHint( QPainter::Antialiasing); painter.setPen(Qt::darkGreen); +// Using the (x y w h) overload painter.drawRect(1, 2, 6, 4); //! [2] diff --git a/src/gui/doc/src/coordsys.qdoc b/src/gui/doc/src/coordsys.qdoc index 1856428361..1018b2122b 100644 --- a/src/gui/doc/src/coordsys.qdoc +++ b/src/gui/doc/src/coordsys.qdoc @@ -70,8 +70,15 @@ \li \inlineimage coordinatesystem-rect.png \li \inlineimage coordinatesystem-line.png \row - \li QRect(1, 2, 6, 4) + \li QRect(QPoint(1, 2), QPoint(7, 6)) + \li QLine(QPoint(2, 7), QPoint(6, 1)) + \row + \li \li QLine(2, 7, 6, 1) + \row + \li QRect(QPoint(1, 2), QSize(6, 4)) + \row + \li QRect(1, 2, 6, 4) \endtable \section2 Aliased Painting -- cgit v1.2.3