出错位置:
void MainWindow::on_pushButton_clicked()
{
this->close();
detectingwindow.show();//出错
detectingwindow.exec();//出错
this->show();
}
这个程序段是mainwindow.cpp里的,我开头有#include "mainwindow.h",在mainwindow.h里有#include "detectingwindow.h",detecting.h内容如下:
#ifndef DETECTINGWINDOW_H
#define DETECTINGWINDOW_H
#include <QWidget>
namespace Ui {
class detectingwindow;
}
class detectingwindow : public QWidget
{
Q_OBJECT
public:
explicit detectingwindow(QWidget *parent = 0);
~detectingwindow();
private:
Ui::detectingwindow *ui;
};
#endif // DETECTINGWINDOW_H