Mercurial > hg > easyhg
annotate src/dateitem.h @ 390:ef31a55c86b6 item_appearance_adjustments
Add little yellow star to current item
author | Chris Cannam |
---|---|
date | Tue, 24 May 2011 17:21:31 +0100 |
parents | b9c153e00e84 |
children |
rev | line source |
---|---|
Chris@57 | 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ |
Chris@57 | 2 |
Chris@57 | 3 /* |
Chris@57 | 4 EasyMercurial |
Chris@57 | 5 |
Chris@57 | 6 Based on HgExplorer by Jari Korhonen |
Chris@57 | 7 Copyright (c) 2010 Jari Korhonen |
Chris@244 | 8 Copyright (c) 2011 Chris Cannam |
Chris@244 | 9 Copyright (c) 2011 Queen Mary, University of London |
Chris@57 | 10 |
Chris@57 | 11 This program is free software; you can redistribute it and/or |
Chris@57 | 12 modify it under the terms of the GNU General Public License as |
Chris@57 | 13 published by the Free Software Foundation; either version 2 of the |
Chris@57 | 14 License, or (at your option) any later version. See the file |
Chris@57 | 15 COPYING included with this distribution for more information. |
Chris@57 | 16 */ |
Chris@57 | 17 |
Chris@53 | 18 #ifndef DATEITEM_H |
Chris@53 | 19 #define DATEITEM_H |
Chris@53 | 20 |
Chris@168 | 21 #include <QGraphicsObject> |
Chris@53 | 22 |
Chris@168 | 23 class DateItem : public QGraphicsObject |
Chris@53 | 24 { |
Chris@168 | 25 Q_OBJECT |
Chris@168 | 26 |
Chris@53 | 27 public: |
Chris@168 | 28 DateItem(); |
Chris@53 | 29 |
Chris@53 | 30 virtual QRectF boundingRect() const; |
Chris@53 | 31 virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); |
Chris@53 | 32 |
Chris@53 | 33 void setRows(int minrow, int n); |
Chris@53 | 34 void setCols(int mincol, int n); |
Chris@53 | 35 |
Chris@53 | 36 void setEven(bool e) { m_even = e; } |
Chris@53 | 37 |
Chris@53 | 38 QString dateString() const { return m_dateString; } |
Chris@53 | 39 void setDateString(QString s) { m_dateString = s; } |
Chris@53 | 40 |
Chris@168 | 41 signals: |
Chris@168 | 42 void clicked(); |
Chris@168 | 43 |
Chris@168 | 44 protected: |
Chris@168 | 45 virtual void mousePressEvent(QGraphicsSceneMouseEvent *); |
Chris@168 | 46 |
Chris@53 | 47 private: |
Chris@53 | 48 QString m_dateString; |
Chris@53 | 49 int m_minrow; |
Chris@53 | 50 int m_maxrow; |
Chris@53 | 51 int m_mincol; |
Chris@53 | 52 int m_maxcol; |
Chris@53 | 53 bool m_even; |
Chris@53 | 54 }; |
Chris@53 | 55 |
Chris@53 | 56 #endif // DATEITEM_H |