summaryrefslogtreecommitdiffstats
path: root/graphbarwidget.h
diff options
context:
space:
mode:
authoram <am@f440f766-f032-0410-8965-dc7d17de2ca0>2009-11-28 16:00:04 +0000
committeram <am@f440f766-f032-0410-8965-dc7d17de2ca0>2009-11-28 16:00:04 +0000
commit2038b81df36cc44b63c44313a4fe39557c850760 (patch)
tree6a5144bfbc63d04c69a5168c206c05d1887c2179 /graphbarwidget.h
parentb61c945e41f1df211097ada08a264618e3da56e3 (diff)
downloadSheMov-2038b81df36cc44b63c44313a4fe39557c850760.tar.gz
SheMov-2038b81df36cc44b63c44313a4fe39557c850760.tar.bz2
SheMov-2038b81df36cc44b63c44313a4fe39557c850760.zip
-turned QualityStats into general purpose class GraphBarWidget
git-svn-id: file:///var/svn/repos2/shemov/trunk@429 f440f766-f032-0410-8965-dc7d17de2ca0
Diffstat (limited to 'graphbarwidget.h')
-rw-r--r--graphbarwidget.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/graphbarwidget.h b/graphbarwidget.h
new file mode 100644
index 0000000..af7c8ba
--- /dev/null
+++ b/graphbarwidget.h
@@ -0,0 +1,45 @@
+/*
+ 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 <QWidget>
+#include <QVariant>
+#include <QSize>
+
+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<QList<QVariant> > 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<QList<QVariant> > mData;
+ QList<QSize> mSizes;
+
+};
+
+#endif