qt中怎么实现按下pushbutton键调用自己的函数。
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了qt中怎么实现按下pushbutton键调用自己的函数。相关的知识,希望对你有一定的参考价值。
参考技术A 要求按下关机按钮你能实现关机功能,谁能帮我改下。 补充: #include <QtGui/QApplication>#include<iostream>#include<QPushButton>using 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 <QtGui/QApplication>#include<iostream>#include<QPushButton>using 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 <QtGui/QApplication>#include<iostream>#include<QPushButton>using 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 <QtGui/QApplication>#include<iostream>#include<QPushButton>using 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 <QtGui/QApplication>#include<iostream>#include<QPushButton>using 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 <QtGui/QApplication>#include<iostream>#include<QPushButton>using 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 <QtGui/QApplication>#include<iostream>#include<QPushButton>using 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();
要求按下关机按钮你能实现关机功能,谁能帮我改下。本回答被提问者采纳
以上是关于qt中怎么实现按下pushbutton键调用自己的函数。的主要内容,如果未能解决你的问题,请参考以下文章