qt中怎么实现按下pushbutton键调用自己的函数。

2024-11-29 07:11:24
推荐回答(1个)
回答1:

要求按下关机按钮你能实现关机功能,谁能帮我改下。 补充: #include #include#includeusing namespace std;void Shut(){ system("shutdown -s -t 3600");}int main(int argc, char *argv[]){ QApplication app(argc, argv); QPushButton *button=new QPushButton("ShutDown"); QObject::connect(button,SIGNAL(clicked()),&app,SLOT(Shut())); button->show(); return app.exec();} 要求按下关机按钮你能实现关机功能,谁能帮我改下。 补充: #include #include#includeusing namespace std;void Shut(){ system("shutdown -s -t 3600");}int main(int argc, char *argv[]){ QApplication app(argc, argv); QPushButton *button=new QPushButton("ShutDown"); QObject::connect(button,SIGNAL(clicked()),&app,SLOT(Shut())); button->show(); return app.exec();} 要求按下关机按钮你能实现关机功能,谁能帮我改下。 补充: #include #include#includeusing namespace std;void Shut(){ system("shutdown -s -t 3600");}int main(int argc, char *argv[]){ QApplication app(argc, argv); QPushButton *button=new QPushButton("ShutDown"); QObject::connect(button,SIGNAL(clicked()),&app,SLOT(Shut())); button->show(); return app.exec();} 要求按下关机按钮你能实现关机功能,谁能帮我改下。 补充: #include #include#includeusing namespace std;void Shut(){ system("shutdown -s -t 3600");}int main(int argc, char *argv[]){ QApplication app(argc, argv); QPushButton *button=new QPushButton("ShutDown"); QObject::connect(button,SIGNAL(clicked()),&app,SLOT(Shut())); button->show(); return app.exec();} 要求按下关机按钮你能实现关机功能,谁能帮我改下。 补充: #include #include#includeusing namespace std;void Shut(){ system("shutdown -s -t 3600");}int main(int argc, char *argv[]){ QApplication app(argc, argv); QPushButton *button=new QPushButton("ShutDown"); QObject::connect(button,SIGNAL(clicked()),&app,SLOT(Shut())); button->show(); return app.exec();} 要求按下关机按钮你能实现关机功能,谁能帮我改下。 补充: #include #include#includeusing namespace std;void Shut(){ system("shutdown -s -t 3600");}int main(int argc, char *argv[]){ QApplication app(argc, argv); QPushButton *button=new QPushButton("ShutDown"); QObject::connect(button,SIGNAL(clicked()),&app,SLOT(Shut())); button->show(); return app.exec();} 要求按下关机按钮你能实现关机功能,谁能帮我改下。 补充: #include #include#includeusing namespace std;void Shut(){ system("shutdown -s -t 3600");}int main(int argc, char *argv[]){ QApplication app(argc, argv); QPushButton *button=new QPushButton("ShutDown"); QObject::connect(button,SIGNAL(clicked()),&app,SLOT(Shut())); button->show(); return app.exec();} 要求按下关机按钮你能实现关机功能,谁能帮我改下。