26 #ifndef QCP_LAYOUTELEMENT_AXISRECT_H
27 #define QCP_LAYOUTELEMENT_AXISRECT_H
29 #include "../global.h"
31 #include "../layout.h"
44 Q_PROPERTY(QPixmap background READ background WRITE setBackground)
45 Q_PROPERTY(
bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
46 Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode)
47 Q_PROPERTY(Qt::Orientations rangeDrag READ rangeDrag WRITE setRangeDrag)
48 Q_PROPERTY(Qt::Orientations rangeZoom READ rangeZoom WRITE setRangeZoom)
55 QPixmap background()
const {
return mBackgroundPixmap; }
56 bool backgroundScaled()
const {
return mBackgroundScaled; }
57 Qt::AspectRatioMode backgroundScaledMode()
const {
return mBackgroundScaledMode; }
58 Qt::Orientations rangeDrag()
const {
return mRangeDrag; }
59 Qt::Orientations rangeZoom()
const {
return mRangeZoom; }
60 QCPAxis *rangeDragAxis(Qt::Orientation orientation);
61 QCPAxis *rangeZoomAxis(Qt::Orientation orientation);
62 double rangeZoomFactor(Qt::Orientation orientation);
65 void setBackground(
const QPixmap &pm);
66 void setBackground(
const QPixmap &pm,
bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
67 void setBackground(
const QBrush &brush);
68 void setBackgroundScaled(
bool scaled);
69 void setBackgroundScaledMode(Qt::AspectRatioMode mode);
70 void setRangeDrag(Qt::Orientations orientations);
71 void setRangeZoom(Qt::Orientations orientations);
74 void setRangeZoomFactor(
double horizontalFactor,
double verticalFactor);
75 void setRangeZoomFactor(
double factor);
80 QList<QCPAxis*> axes(QCPAxis::AxisTypes types)
const;
81 QList<QCPAxis*> axes()
const;
83 QList<QCPAxis*> addAxes(QCPAxis::AxisTypes types);
87 void setupFullAxesBox(
bool connectRanges=
false);
88 QList<QCPAbstractPlottable*> plottables()
const;
89 QList<QCPGraph*> graphs()
const;
90 QList<QCPAbstractItem*> items()
const;
93 int left()
const {
return mRect.left(); }
94 int right()
const {
return mRect.right(); }
95 int top()
const {
return mRect.top(); }
96 int bottom()
const {
return mRect.bottom(); }
97 int width()
const {
return mRect.width(); }
98 int height()
const {
return mRect.height(); }
99 QSize
size()
const {
return mRect.size(); }
100 QPoint
topLeft()
const {
return mRect.topLeft(); }
101 QPoint
topRight()
const {
return mRect.topRight(); }
104 QPoint
center()
const {
return mRect.center(); }
107 virtual void update(UpdatePhase phase);
108 virtual QList<QCPLayoutElement*>
elements(
bool recursive)
const;
112 QBrush mBackgroundBrush;
113 QPixmap mBackgroundPixmap;
114 QPixmap mScaledBackgroundPixmap;
115 bool mBackgroundScaled;
116 Qt::AspectRatioMode mBackgroundScaledMode;
118 Qt::Orientations mRangeDrag, mRangeZoom;
119 QPointer<QCPAxis> mRangeDragHorzAxis, mRangeDragVertAxis, mRangeZoomHorzAxis, mRangeZoomVertAxis;
120 double mRangeZoomFactorHorz, mRangeZoomFactorVert;
122 QCPRange mDragStartHorzRange, mDragStartVertRange;
123 QCP::AntialiasedElements mAADragBackup, mNotAADragBackup;
126 QHash<QCPAxis::AxisType, QList<QCPAxis*> > mAxes;
149 #endif // QCP_LAYOUTELEMENT_AXISRECT_H
virtual void mouseMoveEvent(QMouseEvent *event)
Definition: layout.h:136
QPoint bottomLeft() const
Definition: layoutelement-axisrect.h:102
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
Definition: layout.h:142
Represents the range an axis is encompassing.
Definition: range.h:31
int width() const
Definition: layoutelement-axisrect.h:97
virtual void wheelEvent(QWheelEvent *event)
Definition: layout.h:139
virtual void mousePressEvent(QMouseEvent *event)
Definition: layout.h:135
QCPLayoutInset * insetLayout() const
Definition: layoutelement-axisrect.h:85
int right() const
Definition: layoutelement-axisrect.h:94
virtual int calculateAutoMargin(QCP::MarginSide side)
Definition: layout.cpp:580
virtual void draw(QCPPainter *painter)
Definition: layout.h:143
int height() const
Definition: layoutelement-axisrect.h:98
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
Definition: core.h:42
int left() const
Definition: layoutelement-axisrect.h:93
virtual QList< QCPLayoutElement * > elements(bool recursive) const
Definition: layout.cpp:520
QPainter subclass used internally.
Definition: painter.h:111
The abstract base class for all objects that form the layout system.
Definition: layout.h:65
Holds multiple axes and arranges them in a rectangular shape.
Definition: layoutelement-axisrect.h:40
int top() const
Definition: layoutelement-axisrect.h:95
Manages a single axis inside a QCustomPlot.
Definition: axis.h:94
QPoint topLeft() const
Definition: layoutelement-axisrect.h:100
The abstract base class for all items in a plot.
Definition: item.h:143
A layout that places child elements aligned to the border or arbitrarily positioned.
Definition: layout.h:259
QPoint bottomRight() const
Definition: layoutelement-axisrect.h:103
AxisType
Definition: axis.h:156
QSize size() const
Definition: layoutelement-axisrect.h:99
A plottable representing a graph in a plot.
Definition: plottable-graph.h:60
virtual void mouseReleaseEvent(QMouseEvent *event)
Definition: layout.h:137
int bottom() const
Definition: layoutelement-axisrect.h:96
The abstract base class for all data representing objects in a plot.
Definition: plottable.h:36
MarginSide
Definition: global.h:78
QPoint center() const
Definition: layoutelement-axisrect.h:104
virtual void update(UpdatePhase phase)
Definition: layout.cpp:463
QPoint topRight() const
Definition: layoutelement-axisrect.h:101