/* 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 STATISTICSDIALOG_H #define STATISTICSDIALOG_H #include #include #include #include #include #include "smdialog.h" class QPaintEvent; class StatisticsDialog : public SmDialog { Q_OBJECT public: StatisticsDialog(QWidget *parent = 0, Qt::WindowFlags f = 0); private: QList > queryData(const QString &query) const; QString generalStatistics() const; }; class GraphWidget : public QWidget { Q_OBJECT public: GraphWidget(const QList > data, const QString header, QWidget *parent = 0); GraphWidget(const QString &text, const QString header, QWidget *parent = 0); virtual ~GraphWidget() {} virtual QSize sizeHint() const; protected: virtual void paintEvent(QPaintEvent *event); private: QList > mData; int mDescWidth; const int mBarHeight; const int mMargin; const QString mHeader; QSize mHeaderSize; QFont mHeaderFont; QFont mDataFont; int mMaxValue; int mPercentageWidth; int mTotal; const QString mText; bool mIsText; QTextDocument mDoc; }; #endif