Actually it should work. No connections are needed since this is done via eventHandling. Here is a minimal application that does work but without forms (I never use designer):
#include <QApplication>
#include <QtGui>
{
Q_OBJECT
};
#include "main.moc"
int main(int argc, char* argv[])
{
Dialog d;
d.show();
return app.exec();
}
#include <QApplication>
#include <QtGui>
class Dialog : public QDialog
{
Q_OBJECT
public: Dialog(QWidget* parent=0) : QDialog(parent){}
protected: void closeEvent(QCloseEvent* e) { QMessageBox::information(NULL, "here", "closing the app"); }
};
#include "main.moc"
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
Dialog d;
d.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Compare with your example. You can save it as main.cpp, do qmake and friends and run it to see whether it works.
cheers
Bookmarks