42 Q_PROPERTY(QString name READ name)
43 Q_PROPERTY(
int index READ index)
44 Q_PROPERTY(QList<QCPLayerable*> children READ children)
51 QCustomPlot *parentPlot()
const {
return mParentPlot; }
52 QString name()
const {
return mName; }
53 int index()
const {
return mIndex; }
54 QList<QCPLayerable*>
children()
const {
return mChildren; }
61 QList<QCPLayerable*> mChildren;
74 class QCP_LIB_DECL QCPLayerable : public QObject
78 Q_PROPERTY(
bool visible READ visible WRITE setVisible)
79 Q_PROPERTY(QCustomPlot* parentPlot READ parentPlot)
80 Q_PROPERTY(QCPLayerable* parentLayerable READ parentLayerable)
81 Q_PROPERTY(
QCPLayer* layer READ layer WRITE setLayer)
82 Q_PROPERTY(
bool antialiased READ antialiased WRITE setAntialiased)
85 QCPLayerable(QCustomPlot *plot, QString targetLayer=
"", QCPLayerable *parentLayerable=0);
89 bool visible()
const {
return mVisible; }
90 QCustomPlot *parentPlot()
const {
return mParentPlot; }
92 QCPLayer *layer()
const {
return mLayer; }
93 bool antialiased()
const {
return mAntialiased; }
96 void setVisible(
bool on);
98 bool setLayer(
const QString &layerName);
99 void setAntialiased(
bool enabled);
102 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
105 bool realVisibility()
const;
110 QCustomPlot *mParentPlot;
111 QPointer<QCPLayerable> mParentLayerable;
116 virtual void parentPlotInitialized(QCustomPlot *parentPlot);
118 virtual QRect clipRect()
const;
119 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const = 0;
122 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
123 virtual void deselectEvent(
bool *selectionStateChanged);
126 void initializeParentPlot(QCustomPlot *parentPlot);
127 void setParentLayerable(QCPLayerable* parentLayerable);
128 bool moveToLayer(
QCPLayer *layer,
bool prepend);
132 Q_DISABLE_COPY(QCPLayerable)
134 friend class QCustomPlot;
138 #endif // QCP_LAYER_H