/* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef GRAPHBARWIDGET_H #define GRAPHBARWIDGET_H #include #include #include class QPaintEvent; class GraphBarWidget : public QWidget { Q_OBJECT Q_PROPERTY(int maxValue READ maxValue); Q_PROPERTY(QSize maxDescr READ maxDescr); Q_PROPERTY(QSize maxCount READ maxCount); Q_PROPERTY(QString caption READ caption WRITE setCaption); public: GraphBarWidget(const QList > data, QWidget *parent = 0); ~GraphBarWidget() {} QString caption() const { return mCaption; } void setCaption(const QString &caption) { mCaption = caption; } int maxValue() const; QSize maxDescr() const; QSize maxCount() const; virtual QSize sizeHint() const; protected: void paintEvent(QPaintEvent *); private: int mBarHeight; int mMargin; QString mCaption; QList > mData; QList mSizes; }; #endif