error: undefined reference to `vtable for n qt出现这种问题怎么解决啊
诣澜 2015-08-16 05:34:09 各种办法不灵,不知道怎么弄了
#include "mainwindow.h"
#include <QApplication>
#include <QtGui>
#include<QtWidgets>
class notepad:public QWidget
{
Q_OBJECT
public:
notepad();
QTextEdit *qte;
QPushButton *qpb;
QVBoxLayout *qvbl;
public slots:
void quit();
};
notepad::notepad(){
qte =new QTextEdit;
qpb=new QPushButton("退出");
connect(qpb,SIGNAL(clicked()),this,SLOT(quit()));
qvbl->addWidget(qte);
qvbl->addWidget(qpb);
setLayout(qvbl);
}
void notepad::quit(){
qApp->quit;
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
/* MainWindow w;
w.show();*/
notepad b;
return a.exec();
}