#ifndef QFUNCTION_HPP #define QFUNCTION_HPP #include #include class QFunction : public QObject { Q_OBJECT std::function m_func; public: explicit QFunction(std::function 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 &get(); // 拷贝构造函数 signals: }; #endif // QFUNCTION_HPP