Mercurial > hg > easyhg
comparison uncommitteditem.h @ 129:4986642800f0
* Initial work on showing uncommitted changes (as dashed box) in history graph
author | Chris Cannam |
---|---|
date | Mon, 29 Nov 2010 20:53:34 +0000 |
parents | |
children | e6c6b88d19b9 |
comparison
equal
deleted
inserted
replaced
128:fcaf09ee825d | 129:4986642800f0 |
---|---|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ | |
2 | |
3 /* | |
4 EasyMercurial | |
5 | |
6 Based on HgExplorer by Jari Korhonen | |
7 Copyright (c) 2010 Jari Korhonen | |
8 Copyright (c) 2010 Chris Cannam | |
9 Copyright (c) 2010 Queen Mary, University of London | |
10 | |
11 This program is free software; you can redistribute it and/or | |
12 modify it under the terms of the GNU General Public License as | |
13 published by the Free Software Foundation; either version 2 of the | |
14 License, or (at your option) any later version. See the file | |
15 COPYING included with this distribution for more information. | |
16 */ | |
17 | |
18 #ifndef UNCOMMITTEDITEM_H | |
19 #define UNCOMMITTEDITEM_H | |
20 | |
21 #include <QGraphicsItem> | |
22 #include <QFont> | |
23 | |
24 class UncommittedItem : public QObject, public QGraphicsItem | |
25 { | |
26 Q_OBJECT | |
27 Q_INTERFACES(QGraphicsItem) | |
28 | |
29 public: | |
30 UncommittedItem(); | |
31 | |
32 virtual QRectF boundingRect() const; | |
33 virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); | |
34 | |
35 QString branch() const { return m_branch; } | |
36 void setBranch(QString b) { m_branch = b; } | |
37 | |
38 int column() const { return m_column; } | |
39 int row() const { return m_row; } | |
40 void setColumn(int c) { m_column = c; setX(c * 100); } | |
41 void setRow(int r) { m_row = r; setY(r * 90); } | |
42 | |
43 bool isWide() const { return m_wide; } | |
44 void setWide(bool w) { m_wide = w; } | |
45 | |
46 private: | |
47 QString m_branch; | |
48 QFont m_font; | |
49 int m_column; | |
50 int m_row; | |
51 bool m_wide; | |
52 }; | |
53 | |
54 #endif // UNCOMMITTEDITEM_H |