Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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
9//! [0]
10QPolygon polygon;
11polygon << QPoint(10, 20) << QPoint(20, 30);
12//! [0]
13}
14
15{
16// STREAMF
17//! [1]
18QPolygonF polygon;
19polygon << QPointF(10.4, 20.5) << QPointF(20.2, 30.2);
20//! [1]
21}
22
23{
24// SETPOINTS
25//! [2]
26static const int points[] = { 10, 20, 30, 40 };
27QPolygon polygon;
28polygon.setPoints(2, points);
29//! [2]
30}
31
32{
33// SETPOINTS2
34//! [3]
35QPolygon polygon;
36polygon.setPoints(2, 10, 20, 30, 40);
37//! [3]
38}
39
40{
41// PUTPOINTS
42//! [4]
43QPolygon polygon(1);
44polygon[0] = QPoint(4, 5);
45polygon.putPoints(1, 2, 6,7, 8,9);
46//! [4]
47}
48
49{
50// PUTPOINTS2
51//! [5]
52QPolygon polygon(3);
53polygon.putPoints(0, 3, 4,5, 0,0, 8,9);
54polygon.putPoints(1, 1, 6,7);
55//! [5]
56}
57
58{
59// PUTPOINTS3
60//! [6]
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);
71//! [6]
72}
73
74} // wrapper
75} // polygon
void wrapper()
Definition polygon.cpp:6