How can I simple open a program perform some actions and then close it?
Already tried:
QTimer::singleShot(10,
&a,
SLOT(quit
()) );
QTimer::singleShot(10, &a, SLOT(quit()) );
To copy to clipboard, switch view to plain text mode
Inside the mainform... but I do not have access to the application pointer...
Base code for what I want:
msgBox.setText("Bla bla bla");
msgBox.setDefaultButton(opt2);
msgBox.exec();
if(msgBox.clickedButton() == opt1)
{
//some actions...
//Close the entire program!
}
msgBox.setText("Bla bla bla");
QPushButton *opt1 = msgBox.addButton(tr("First One!"), QMessageBox::ActionRole);
QPushButton *opt2 = msgBox.addButton(tr("Second One!"), QMessageBox::ActionRole);
msgBox.setDefaultButton(opt2);
msgBox.setIcon(QMessageBox::Warning);
msgBox.exec();
if(msgBox.clickedButton() == opt1)
{
//some actions...
//Close the entire program!
}
To copy to clipboard, switch view to plain text mode
Bookmarks