forked from dimv36/QCustomPlot-PyQt5
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathitem.sip
109 lines (94 loc) · 4.14 KB
/
item.sip
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/** PyQt5 binding for QCustomPlot v2.0.0
*
* Authors: Dmitry Voronin, Giuseppe Corbelli
* License: MIT
*
* QCustomPlot author: Emanuel Eichhammer
* QCustomPlot Website/Contact: http://www.qcustomplot.com
*/
class QCPItemAnchor /NoDefaultCtors/
{
%TypeHeaderCode
#include <QCustomPlot/src/item.h>
%End
public:
QCPItemAnchor(QCustomPlot *parentPlot /TransferThis/, QCPAbstractItem *parentItem, const QString &name, int anchorId=-1);
virtual ~QCPItemAnchor();
// getters:
QString name() const;
virtual QPointF pixelPosition() const;
};
class QCPItemPosition : public QCPItemAnchor /NoDefaultCtors/
{
%TypeHeaderCode
#include <QCustomPlot/src/item.h>
%End
public:
enum PositionType { ptAbsolute ///< Static positioning in pixels, starting from the top left corner of the viewport/widget.
,ptViewportRatio ///< Static positioning given by a fraction of the viewport size. For example, if you call setCoords(0, 0), the position will be at the top
///< left corner of the viewport/widget. setCoords(1, 1) will be at the bottom right corner, setCoords(0.5, 0) will be horizontally centered and
///< vertically at the top of the viewport/widget, etc.
,ptAxisRectRatio ///< Static positioning given by a fraction of the axis rect size (see \ref setAxisRect). For example, if you call setCoords(0, 0), the position will be at the top
///< left corner of the axis rect. setCoords(1, 1) will be at the bottom right corner, setCoords(0.5, 0) will be horizontally centered and
///< vertically at the top of the axis rect, etc. You can also go beyond the axis rect by providing negative coordinates or coordinates larger than 1.
,ptPlotCoords ///< Dynamic positioning at a plot coordinate defined by two axes (see \ref setAxes).
};
QCPItemPosition(QCustomPlot *parentPlot /TransferThis/, QCPAbstractItem *parentItem, const QString &name);
virtual ~QCPItemPosition();
// getters:
PositionType type() const;
PositionType typeX() const;
PositionType typeY() const;
QCPItemAnchor *parentAnchor() const;
QCPItemAnchor *parentAnchorX() const;
QCPItemAnchor *parentAnchorY() const;
double key() const;
double value() const;
QPointF coords() const;
QCPAxis *keyAxis() const;
QCPAxis *valueAxis() const;
QCPAxisRect *axisRect() const;
virtual QPointF pixelPosition() const;
// setters:
void setType(PositionType type);
void setTypeX(PositionType type);
void setTypeY(PositionType type);
bool setParentAnchor(QCPItemAnchor *parentAnchor, bool keepPixelPosition=false);
bool setParentAnchorX(QCPItemAnchor *parentAnchor, bool keepPixelPosition=false);
bool setParentAnchorY(QCPItemAnchor *parentAnchor, bool keepPixelPosition=false);
void setCoords(double key, double value);
void setCoords(const QPointF &coords);
void setAxes(QCPAxis* keyAxis, QCPAxis* valueAxis);
void setAxisRect(QCPAxisRect *axisRect);
void setPixelPosition(const QPointF &pixelPosition);
};
class QCPAbstractItem : public QCPLayerable /Abstract/
{
%TypeHeaderCode
#include <QCustomPlot/src/item.h>
%End
public:
explicit QCPAbstractItem(QCustomPlot *parentPlot /TransferThis/);
virtual ~QCPAbstractItem();
// getters:
bool clipToAxisRect() const;
QCPAxisRect *clipAxisRect() const;
bool selectable() const;
bool selected() const;
// setters:
void setClipToAxisRect(bool clip);
void setClipAxisRect(QCPAxisRect *rect);
Q_SLOT void setSelectable(bool selectable);
Q_SLOT void setSelected(bool selected);
// reimplemented virtual methods:
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const = 0;
// non-virtual methods:
QList<QCPItemPosition*> positions() const;
QList<QCPItemAnchor*> anchors() const;
QCPItemPosition *position(const QString &name) const;
QCPItemAnchor *anchor(const QString &name) const;
bool hasAnchor(const QString &name) const;
signals:
void selectionChanged(bool selected);
void selectableChanged(bool selectable);
};