comparison changesetitem.h @ 53:3c46b2ac45d3

* Put proper labels &c in changeset items; colour branches and users; etc
author Chris Cannam
date Fri, 12 Nov 2010 16:48:18 +0000
parents bd3accba9b3f
children 261bfb9481fe
comparison
equal deleted inserted replaced
52:384420567575 53:3c46b2ac45d3
1 #ifndef CHANGESETITEM_H 1 #ifndef CHANGESETITEM_H
2 #define CHANGESETITEM_H 2 #define CHANGESETITEM_H
3 3
4 #include <QGraphicsItem> 4 #include <QGraphicsItem>
5 #include <QFont>
5 6
6 class Changeset; 7 class Changeset;
7 8
8 class ChangesetItem : public QGraphicsItem 9 class ChangesetItem : public QGraphicsItem
9 { 10 {
10 public: 11 public:
11 ChangesetItem(Changeset *cs) : m_changeset(cs), m_column(0), m_row(0) { } 12 ChangesetItem(Changeset *cs);
12 13
13 virtual QRectF boundingRect() const; 14 virtual QRectF boundingRect() const;
14 virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); 15 virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
15 16
17 Changeset *getChangeset() { return m_changeset; }
18
16 int column() const { return m_column; } 19 int column() const { return m_column; }
17 int row() const { return m_row; } 20 int row() const { return m_row; }
18 void setColumn(int c) { m_column = c; setX(c * 100); } 21 void setColumn(int c) { m_column = c; setX(c * 100); }
19 void setRow(int r) { m_row = r; setY(r * 100); } 22 void setRow(int r) { m_row = r; setY(r * 90); }
20 23
21 private: 24 private:
25 QFont m_font;
22 Changeset *m_changeset; 26 Changeset *m_changeset;
23 int m_column; 27 int m_column;
24 int m_row; 28 int m_row;
25 }; 29 };
26 30