comparison src/dateitem.h @ 370:b9c153e00e84

Move source files to src/
author Chris Cannam
date Thu, 24 Mar 2011 10:27:51 +0000
parents dateitem.h@8fd71f570884
children
comparison
equal deleted inserted replaced
369:19cce6d2c470 370:b9c153e00e84
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) 2011 Chris Cannam
9 Copyright (c) 2011 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 DATEITEM_H
19 #define DATEITEM_H
20
21 #include <QGraphicsObject>
22
23 class DateItem : public QGraphicsObject
24 {
25 Q_OBJECT
26
27 public:
28 DateItem();
29
30 virtual QRectF boundingRect() const;
31 virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
32
33 void setRows(int minrow, int n);
34 void setCols(int mincol, int n);
35
36 void setEven(bool e) { m_even = e; }
37
38 QString dateString() const { return m_dateString; }
39 void setDateString(QString s) { m_dateString = s; }
40
41 signals:
42 void clicked();
43
44 protected:
45 virtual void mousePressEvent(QGraphicsSceneMouseEvent *);
46
47 private:
48 QString m_dateString;
49 int m_minrow;
50 int m_maxrow;
51 int m_mincol;
52 int m_maxcol;
53 bool m_even;
54 };
55
56 #endif // DATEITEM_H