00001
00002
00003
00004
00005
00006
00007 #ifndef VIEW_PROFILE_DIVIDER_H
00008 #define VIEW_PROFILE_DIVIDER_H
00009
00010 #include <QGraphicsRectItem>
00011 #include <QObject>
00012
00013 class QGraphicsLineItem;
00014 class QGraphicsScene;
00015 class QGraphicsPolygonItem;
00016 class QGraphicsView;
00017
00023 class ViewProfileDivider : public QObject, public QGraphicsRectItem
00024 {
00025 Q_OBJECT;
00026
00027 public:
00029 ViewProfileDivider (QGraphicsScene &scene,
00030 QGraphicsView &view,
00031 int sceneWidth,
00032 int sceneHeight,
00033 int yCenter,
00034 bool isLowerBoundary);
00035
00037 virtual QVariant itemChange (GraphicsItemChange change, const QVariant &value);
00038
00040 virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
00041
00043 void setX (double x,
00044 double xLow,
00045 double xHigh);
00046
00047 private slots:
00049 void slotOtherMoved(double xSceneOther);
00050
00051 signals:
00053 void signalMovedLow (double xSceneOther);
00054
00056 void signalMovedHigh (double xSceneOther);
00057
00058 private:
00059 ViewProfileDivider ();
00060
00061 void sendSignalMoved ();
00062
00063
00064 void updateGeometryDivider ();
00065 void updateGeometryNonPaddle ();
00066 void updateGeometryPaddle ();
00067
00068 QGraphicsView &m_view;
00069 int m_yCenter;
00070 double m_xScene;
00071 double m_xSceneOther;
00072
00073 QGraphicsLineItem *m_divider;
00074 QGraphicsRectItem *m_shadedArea;
00075 QGraphicsPolygonItem *m_arrow;
00076 int m_sceneWidth;
00077 int m_sceneHeight;
00078 bool m_isLowerBoundary;
00079
00080 QPointF m_startDragPos;
00081 };
00082
00083 #endif // VIEW_PROFILE_DIVIDER_H