/******************************************************************************* * * * Société de Transports de Montréal. * * 2012 - 2013 * * * * Projet Zones Tests * * * * * * * *******************************************************************************/ /* Description: Description du fichier si nécessaire. */ /* ************************************************************************** */ /* Revision: ### 20131030 JFM Verision d'origine. ### YYYYMMDD Description du besoin ou du bug Description du changement. */ /* ************************************************************************** */ #ifndef GRAPHRULERWIDGET_H #define GRAPHRULERWIDGET_H #include "GlobalDefine.h" #include #define RULER_NB_TICKS 200 class CGraphRulerWidget : public QGraphicsWidget { Q_OBJECT public: CGraphRulerWidget(qreal RulerPixelWidth,QGraphicsItem *Parent = 0); ~CGraphRulerWidget(); virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); unsigned int SetRange(quint64 StartTime, quint64 EndTime); virtual void resizeEvent(QGraphicsSceneResizeEvent *event); private: qreal mPixelWidth; quint64 mStartTime, mEndTime; qreal mPixelPitch; bool mValidRange; QPixmap *mRulerPixmap; void Render(); }; #endif // GRAPHRULERWIDGET_H