KNewStuff
qprogressindicator.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KNEWSTUFF2_UI_QPROGRESSINDICATOR_H
00023 #define KNEWSTUFF2_UI_QPROGRESSINDICATOR_H
00024
00025 #include <QtGui/QFrame>
00026 #include <QtCore/QHash>
00027
00028 #include <QtCore/QString>
00029
00030 class QVBoxLayout;
00031 class QProgressBar;
00032 class QPushButton;
00033
00042 class QProgressIndicator : public QFrame
00043 {
00044 Q_OBJECT
00045 public:
00046 QProgressIndicator(QWidget *parent);
00047 void addProgress(const QString & message, int percentage);
00048 void removeProgress(const QString & message);
00049 public Q_SLOTS:
00050 void slotClicked();
00051 signals:
00052 void signalJobCanceled(const QString & message);
00053 private:
00054 void calculateAverage();
00055
00056 QHash<QString, int> m_progress;
00057 QHash<QString, QProgressBar*> m_progresswidgets;
00058 QWidget *m_details;
00059 QVBoxLayout *m_detailsvbox;
00060 QProgressBar *m_pb;
00061 QPushButton *m_pbdetails;
00062 };
00063
00064 #endif