Quit Qt application : Signal « Qt « C++






Quit Qt application

  

#include <QApplication>
#include <QPushButton>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QPushButton *button = new QPushButton("Quit");
    QObject::connect(button, SIGNAL(clicked()),&app, SLOT(quit()));
    button->show();
    return app.exec();
}

   
    
  








Related examples in the same category

1.A Slot Responds to a Signal
2.Inherited slot
3.Qt signal test
4.Qt signals and slots
5.Widget style
6.QSignal mapper
7.event filters
8.Multi-event handlers
9.Mark method with Q_INVOKABLE