File: threaddetails.h

package info (click to toggle)
cppcheck 2.20.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,924 kB
  • sloc: cpp: 274,396; python: 22,429; ansic: 8,103; sh: 1,094; makefile: 1,041; xml: 987; cs: 291
file content (44 lines) | stat: -rw-r--r-- 959 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef THREADDETAILS_H
#define THREADDETAILS_H

#include <QWidget>
#include <QMap>
#include <QMutex>
#include <QTimer>
#include "checkthread.h"

namespace Ui {
    class ThreadDetails;
}

class ThreadDetails : public QWidget
{
    Q_OBJECT

public:
    explicit ThreadDetails(QWidget *parent = nullptr);
    ~ThreadDetails() override;

    static ThreadDetails* instance() {
        return mInstance;
    }

public slots:
    void threadDetailsUpdated(QMap<int, CheckThread::Details> threadDetails);
    void progress(QString filename, QString stage, std::size_t value);

private slots:
    void updateUI();

private:
    static ThreadDetails* mInstance;
    Ui::ThreadDetails *mUi;
    QMap<QString, QPair<QString,QString>> mProgress;
    QMap<int, CheckThread::Details> mThreadDetails;
    QTimer mTimer;

    /** accessing mProgress and mThreadDetails in slots that are triggered from different threads */
    QMutex mMutex;
};

#endif // THREADDETAILS_H