vs2010中qt编程,设置一个退出程序button,提示 error C2065: “app”: 未声明的标识符,谢谢
#include"qt06.h"#include<QtWidgets/QApplication>#include<QLabel>#include<QPushButton>...
#include "qt06.h"
#include <QtWidgets/QApplication>
#include <QLabel>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QLabel *label=new QLabel("zsy");
label->show();
QPushButton *button=new QPushButton("ting");
QObject::connect(button,SIGNAL(clicked()), &app, SLOT(quit()));
button->show();
//qt06 w;
//w.show();
return a.exec();
}
调试出现 error C2065: “app”: 未声明的标识符,请问这个问题该如何解决,谢谢 展开
#include <QtWidgets/QApplication>
#include <QLabel>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QLabel *label=new QLabel("zsy");
label->show();
QPushButton *button=new QPushButton("ting");
QObject::connect(button,SIGNAL(clicked()), &app, SLOT(quit()));
button->show();
//qt06 w;
//w.show();
return a.exec();
}
调试出现 error C2065: “app”: 未声明的标识符,请问这个问题该如何解决,谢谢 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询