16,212
社区成员
发帖
与我相关
我的任务
分享
#include <QCoreApplication>
#include "cc.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
// cc *k = new cc;//不会报错
cc k;//会报错
return a.exec();
}
#include "cc.h"
#include <QTimer>
#include <QDebug>
cc::cc(QObject *parent) : QObject(parent)
{
this->deleteLater();
qDebug()<<"deletelater called";
}
#ifndef CC_H
#define CC_H
#include <QObject>
class cc : public QObject
{
Q_OBJECT
public:
explicit cc(QObject *parent = 0);
signals:
public slots:
};
#endif // CC_H