Mercurial > hg > easyhg
annotate changesetitem.h @ 46:bd3accba9b3f
* Better layout for branches; spline connection paths
author | Chris Cannam |
---|---|
date | Wed, 10 Nov 2010 17:11:41 +0000 |
parents | bed7ab59f62e |
children | 3c46b2ac45d3 |
rev | line source |
---|---|
Chris@43 | 1 #ifndef CHANGESETITEM_H |
Chris@43 | 2 #define CHANGESETITEM_H |
Chris@43 | 3 |
Chris@43 | 4 #include <QGraphicsItem> |
Chris@43 | 5 |
Chris@43 | 6 class Changeset; |
Chris@43 | 7 |
Chris@43 | 8 class ChangesetItem : public QGraphicsItem |
Chris@43 | 9 { |
Chris@43 | 10 public: |
Chris@44 | 11 ChangesetItem(Changeset *cs) : m_changeset(cs), m_column(0), m_row(0) { } |
Chris@43 | 12 |
Chris@43 | 13 virtual QRectF boundingRect() const; |
Chris@43 | 14 virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); |
Chris@43 | 15 |
Chris@44 | 16 int column() const { return m_column; } |
Chris@44 | 17 int row() const { return m_row; } |
Chris@46 | 18 void setColumn(int c) { m_column = c; setX(c * 100); } |
Chris@46 | 19 void setRow(int r) { m_row = r; setY(r * 100); } |
Chris@44 | 20 |
Chris@43 | 21 private: |
Chris@43 | 22 Changeset *m_changeset; |
Chris@44 | 23 int m_column; |
Chris@44 | 24 int m_row; |
Chris@43 | 25 }; |
Chris@43 | 26 |
Chris@43 | 27 #endif // CHANGESETITEM_H |