今天学到关于Qt的几个关键词:Q_DISABLE_COPY(Bluetooth),friend ,
Q_DECLARE_PRIVATE(Bluetooth) Q_Q,
Q_DECLARE_PUBLIC(Bluetooth) Q_D,个人觉得这个用法非常好,有这么一个项目,全部都是以这种方式做的,pimpl的方式。代码如下:
launcher.h
#include <QObject>
class LauncherPrivate;
class Launcher : public QObject
{
Q_OBJECT
Q_DISABLE_COPY(Launcher)
public:
explicit Launcher(QObject *parent = nullptr);
~Launcher();
private:
LauncherPrivate* const d_ptr;
Q_DECLARE_PRIVATE(Launcher)
public slots:
void onStartComplete();
signals:
};