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 <paul.wicking@qt.io>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
This commit is contained in:
Samuel Gaist 2019-05-21 22:02:56 +02:00
parent da23302e4d
commit 1dc1a032a8
2 changed files with 10 additions and 1 deletions

View File

@ -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]

View File

@ -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