hi, i have a small application which builds up a connection to a digital camera. To take a photo you have to set up "releaseMode". After the desired camera operations you have to part this releaseMode to finish clean. Otherwise you couldn't enter the releaseMode again.
so i need to do some cleanup operations. How to realize this? I thought about handling the QCoreApplication::aboutToQuit() signal, but it doesn't work yet.
Here my little test application
the receiver-class
{
Q_OBJECT
public:
Nonce();
~Nonce();
public slots:
void quitter();
};
class Nonce : public QObject
{
Q_OBJECT
public:
Nonce();
~Nonce();
public slots:
void quitter();
};
To copy to clipboard, switch view to plain text mode
quitter method
void Nonce::quitter()
{
std::cout << " aboutToQuit emitted "<< std::endl << std::flush;
}
void Nonce::quitter()
{
std::cout << " aboutToQuit emitted "<< std::endl << std::flush;
}
To copy to clipboard, switch view to plain text mode
and a small main()
int main(int argc, char *argv[])
{
Nonce foo;
QObject::connect(&a,
SIGNAL(aboutToQuit
()),
&foo, SLOT(quitter()));
return a.exec();
}
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
Nonce foo;
QObject::connect(&a, SIGNAL(aboutToQuit()),
&foo, SLOT(quitter()));
return a.exec();
}
To copy to clipboard, switch view to plain text mode
so.. when i "kill" the programm anyway the quitter method should be started, there i want leave the releaseMode.
any Ideas where are my faults? (yeah, I am quite new to Qt)
Bookmarks