You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
525 B
26 lines
525 B
#ifndef QFUNCTION_HPP
|
|
#define QFUNCTION_HPP
|
|
|
|
#include <QObject>
|
|
#include <functional>
|
|
class QFunction : public QObject {
|
|
Q_OBJECT
|
|
|
|
std::function<void()> m_func;
|
|
|
|
public:
|
|
explicit QFunction(std::function<void()> func, QObject *parent = nullptr);
|
|
QFunction();
|
|
QFunction(const QFunction &other) { m_func = other.m_func; }
|
|
QFunction &operator=(const QFunction &other) {
|
|
m_func = other.m_func;
|
|
return *this;
|
|
}
|
|
std::function<void()> &get();
|
|
|
|
// 拷贝构造函数
|
|
|
|
signals:
|
|
};
|
|
|
|
#endif // QFUNCTION_HPP
|