QT编译出错:expected unqualified-id before'.'token

出错位置:
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

第1个回答  2015-04-15
detectingwindow的声明和定义在哪?

detectingwindow* pwin = new detectingwindow();

pwin->show();
pwin->exec();本回答被提问者采纳
第2个回答  2015-04-15
detectingwindow是个类不是对象名,没定义
相似回答