00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef LINE_VIEW_H
00023 #define LINE_VIEW_H
00024
00025 #include "ViewItem.h"
00026
00027 class LineView : public ViewItem
00028 {
00029 Q_OBJECT
00030 public:
00031
00032 LineView(ViewItem* parent) : ViewItem(parent, 0)
00033 {
00034 setZValue(parent->zValue() + 1);
00035 m_boundingRect = QRectF(0, 0, 1, parent->boundingRect().height());
00036 }
00037 void set_bounding_rect(QRectF rect) {m_boundingRect = rect;}
00038 void set_color(QColor color) {m_color = color;}
00039 void paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidget*)
00040 {
00041 painter->setPen(m_color);
00042 QLineF line(0, 0, 0, m_boundingRect.height());
00043 painter->drawLine(line);
00044 }
00045
00046 private:
00047 QColor m_color;
00048 };
00049
00050 #endif