关于QT Designer生成的ui文件,make 时候总提示"undefined reference to `vtable for"
我用QT Designer 生成了的.ui文件,然后用一个类继承了QDialog 和 makefile 生成的 .ui 对应的C++ 文件,编译总是提示"undefined reference to `vtable for" 这个错误! 贴上代码,求帮忙看下,谢谢!
#ifndef GOCELL_H#define GOCELL_H#include <QDialog>#include "ui_gocell.h"class GoCell : public QDialog, public Ui::ToCellDialog{ Q_OBJECT public: GoCell(QWidget *parent = 0); private slots: void on_lineEdit_textChanged();};#endif
#include <QApplication>#include "gocell.h"GoCell :: GoCell(QWidget *parent) : QDialog(parent){ setupUi(this); QRegExp regExp("[A-Za-z][0-9]{0, 2}"); lineEdit->setValidator(new QRegExpValidator(regExp, this)); connect(okButton, SIGNAL(clicked()), this, SLOT(accept())); connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));}void GoCell::on_lineEdit_textChanged(){ okButton->setEnabled(lineEdit->hasAcceptableInput());}
#include <QApplication>#include "gocell.h"int main(int argc, char* argv[]){ QApplication app(argc, argv); GoCell *dialog = new GoCell; dialog->show(); return app.exec();}