1#ifndef AVERAGELOADMANAGER_H
2#define AVERAGELOADMANAGER_H
3
4#include <QObject>
5
6class QTimer;
7
8class AverageLoadManager : public QObject
9{
10 Q_OBJECT
11public:
12 explicit AverageLoadManager(QObject *parent = nullptr);
13
14 void activate(bool enabled);
15 bool available() const;
16 QPair<int, int> workersRange() const;
17
18Q_SIGNALS:
19 void recommendedWorkerCount(int);
20
21private Q_SLOTS:
22 void update();
23
24private:
25 QTimer *m_timer;
26 int m_min, m_max;
27};
28
29#endif // AVERAGELOADMANAGER_H
30

source code of threadweaver/examples/ThumbNailer/AverageLoadManager.h