Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
polygon.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3#include <QPolygon>
4namespace polygon {
5
6void wrapper() {
7{
8// STREAM
11polygon << QPoint(10, 20) << QPoint(20, 30);
13}
14
15{
16// STREAMF
19polygon << QPointF(10.4, 20.5) << QPointF(20.2, 30.2);
21}
22
23{
24// SETPOINTS
26static const int points[] = { 10, 20, 30, 40 };
28polygon.setPoints(2, points);
30}
31
32{
33// SETPOINTS2
36polygon.setPoints(2, 10, 20, 30, 40);
38}
39
40{
41// PUTPOINTS
44polygon[0] = QPoint(4, 5);
45polygon.putPoints(1, 2, 6,7, 8,9);
47}
48
49{
50// PUTPOINTS2
53polygon.putPoints(0, 3, 4,5, 0,0, 8,9);
54polygon.putPoints(1, 1, 6,7);
56}
57
58{
59// PUTPOINTS3
61QPolygon polygon1;
62polygon1.putPoints(0, 3, 1,2, 0,0, 5,6);
63// polygon1 is now the three-point polygon(1,2, 0,0, 5,6);
64
65QPolygon polygon2;
66polygon2.putPoints(0, 3, 4,4, 5,5, 6,6);
67// polygon2 is now (4,4, 5,5, 6,6);
68
69polygon1.putPoints(2, 3, polygon2);
70// polygon1 is now the five-point polygon(1,2, 0,0, 4,4, 5,5, 6,6);
72}
73
74} // wrapper
75} // polygon
\inmodule QtCore\reentrant
Definition qpoint.h:217
\inmodule QtCore\reentrant
Definition qpoint.h:25
The QPolygonF class provides a list of points using floating point precision.
Definition qpolygon.h:96
The QPolygon class provides a list of points using integer precision.
Definition qpolygon.h:23
Q_GUI_EXPORT void putPoints(int index, int nPoints, const int *points)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qpolygon.cpp:303
void wrapper()
Definition polygon.cpp:6
GLfixed GLfixed GLint GLint GLfixed points