PDA

View Full Version : Problem regarding GUI application



sudheer168
3rd July 2009, 14:56
Hi ,I am using QT4 on windowsXP. I developed a QT GUI application using QMainWindow as main class.Now my problem is ,if I close the window by clicking on close button of window(which is on top most right corner of window) I need to ask wether to close the application or not .if YES then it have to be close or if NO the application should not be close.So suggest me to do this.
So please help me to solve this problem.

With regards ,
Sudheer.

AcerExtensa
3rd July 2009, 15:13
You can reimplement closeEvent of QWidget.


void QWidget::closeEvent ( QCloseEvent * e ) [virtual protected]

Example is here: _https://cgs.hpi.uni-potsdam.de/doxygen/qt/qaction-application-example.html#x1173

sudheer168
4th July 2009, 12:36
Thanks a lot for your kind reply.

with regards
sudheer