Mercurial > hg > easyhg
comparison changesetitem.h @ 119:005a54380502
* Make scene remember which item has its details showing, and remove the previous one when a new one is clicked
author | Chris Cannam |
---|---|
date | Sun, 28 Nov 2010 21:52:00 +0000 |
parents | d5db15bf250c |
children | fcaf09ee825d |
comparison
equal
deleted
inserted
replaced
118:9734fb0d6fff | 119:005a54380502 |
---|---|
22 #include <QFont> | 22 #include <QFont> |
23 | 23 |
24 class Changeset; | 24 class Changeset; |
25 class ChangesetDetailItem; | 25 class ChangesetDetailItem; |
26 | 26 |
27 class ChangesetItem : public QGraphicsItem | 27 class ChangesetItem : public QObject, public QGraphicsItem |
28 { | 28 { |
29 Q_OBJECT | |
30 Q_INTERFACES(QGraphicsItem) | |
31 | |
29 public: | 32 public: |
30 ChangesetItem(Changeset *cs); | 33 ChangesetItem(Changeset *cs); |
31 | 34 |
32 virtual QRectF boundingRect() const; | 35 virtual QRectF boundingRect() const; |
33 virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); | 36 virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); |
43 void setWide(bool w) { m_wide = w; } | 46 void setWide(bool w) { m_wide = w; } |
44 | 47 |
45 bool shouldShowBranch() const { return m_showBranch; } | 48 bool shouldShowBranch() const { return m_showBranch; } |
46 void setShowBranch(bool s) { m_showBranch = s; } | 49 void setShowBranch(bool s) { m_showBranch = s; } |
47 | 50 |
51 signals: | |
52 void detailShown(); | |
53 void detailHidden(); | |
54 | |
55 public slots: | |
56 void showDetail(); | |
57 void hideDetail(); | |
58 | |
48 protected: | 59 protected: |
49 virtual void mousePressEvent(QGraphicsSceneMouseEvent *); | 60 virtual void mousePressEvent(QGraphicsSceneMouseEvent *); |
50 | 61 |
51 private: | 62 private: |
52 QFont m_font; | 63 QFont m_font; |