AsyncProgressDialog
TaskThread.h
1 #pragma once
2 
3 #include "TimeStamp.h"
4 
5 #include <QThread>
6 #include <QVariant>
7 
8 namespace APD
9 {
10 
11 class TaskThread : public QThread
12 {
13  Q_OBJECT
14 
15 public:
16  explicit TaskThread(QObject* parent = nullptr);
17  ~TaskThread();
18 
19  void setRange(int minimum, int maximum);
20  void setValue(int value, const QVariant& userValue = QVariant());
21  void setText(const QString& text);
22 
23  bool isCanceled() const;
24 
25 public slots:
26  void cancel();
27 
28 signals:
29  void valueChanged(int value, const QVariant& userValue, const TimeStamp& timeStamp);
30  void rangeChanged(int minimum, int maximum);
31  void textChanged(const QString& text);
32 
33 private:
34  Q_DISABLE_COPY(TaskThread)
35 
36  struct Impl;
37  std::unique_ptr<Impl> m_impl;
38 };
39 
40 }
void setText(const QString &text)
Definition: TaskThread.cpp:89
bool isCanceled() const
Definition: TaskThread.cpp:99
void rangeChanged(int minimum, int maximum)
TaskThread(QObject *parent=nullptr)
Definition: TaskThread.cpp:47
void textChanged(const QString &text)
void setValue(int value, const QVariant &userValue=QVariant())
Definition: TaskThread.cpp:78
Base class for all threads capable of reporting progress and cancelling the progress when requested.
Definition: TaskThread.h:11
void setRange(int minimum, int maximum)
Definition: TaskThread.cpp:64
void valueChanged(int value, const QVariant &userValue, const TimeStamp &timeStamp)
void cancel()
Definition: TaskThread.cpp:112