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>
4
namespace
polygon
{
5
6
void
wrapper
() {
7
{
8
// STREAM
10
QPolygon
polygon
;
11
polygon
<<
QPoint
(10, 20) <<
QPoint
(20, 30);
13
}
14
15
{
16
// STREAMF
18
QPolygonF
polygon
;
19
polygon
<<
QPointF
(10.4, 20.5) <<
QPointF
(20.2, 30.2);
21
}
22
23
{
24
// SETPOINTS
26
static
const
int
points
[] = { 10, 20, 30, 40 };
27
QPolygon
polygon
;
28
polygon
.setPoints(2,
points
);
30
}
31
32
{
33
// SETPOINTS2
35
QPolygon
polygon
;
36
polygon
.setPoints(2, 10, 20, 30, 40);
38
}
39
40
{
41
// PUTPOINTS
43
QPolygon
polygon
(1);
44
polygon
[0] =
QPoint
(4, 5);
45
polygon
.putPoints(1, 2, 6,7, 8,9);
47
}
48
49
{
50
// PUTPOINTS2
52
QPolygon
polygon
(3);
53
polygon
.putPoints(0, 3, 4,5, 0,0, 8,9);
54
polygon
.putPoints(1, 1, 6,7);
56
}
57
58
{
59
// PUTPOINTS3
61
QPolygon
polygon1;
62
polygon1.
putPoints
(0, 3, 1,2, 0,0, 5,6);
63
// polygon1 is now the three-point polygon(1,2, 0,0, 5,6);
64
65
QPolygon
polygon2;
66
polygon2.
putPoints
(0, 3, 4,4, 5,5, 6,6);
67
// polygon2 is now (4,4, 5,5, 6,6);
68
69
polygon1.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
QPointF
\inmodule QtCore\reentrant
Definition
qpoint.h:217
QPoint
\inmodule QtCore\reentrant
Definition
qpoint.h:25
QPolygonF
The QPolygonF class provides a list of points using floating point precision.
Definition
qpolygon.h:96
QPolygon
The QPolygon class provides a list of points using integer precision.
Definition
qpolygon.h:23
QPolygon::putPoints
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
polygon
Definition
polygon.cpp:4
polygon::wrapper
void wrapper()
Definition
polygon.cpp:6
points
GLfixed GLfixed GLint GLint GLfixed points
Definition
qopenglext.h:5206
qtbase
src
gui
doc
snippets
polygon
polygon.cpp
Generated by
1.10.0