How to access Quit Slot without aplication pointer...
How can I simple open a program perform some actions and then close it?
Already tried:
Code:
QTimer::singleShot(10,
&a,
SLOT(quit
()) );
Inside the mainform... but I do not have access to the application pointer...
Base code for what I want:
Code:
msgBox.setText("Bla bla bla");
msgBox.setDefaultButton(opt2);
msgBox.exec();
if(msgBox.clickedButton() == opt1)
{
//some actions...
//Close the entire program!
}
Re: How to access Quit Slot without aplication pointer...
By the way.. we cant forget that Qt still is C++ related so...
this solves everything:
thanks anyway :)
Re: How to access Quit Slot without aplication pointer...
Quote:
Originally Posted by
Cayan
That's a bad way to exit a GUI app. If you need a pointer to your application use QCoreApplication::instance() or the short hand qApp.