maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   QDialog, how to detect when user clicks background window? (https://talk.maemo.org/showthread.php?t=44310)

tmsha 2010-02-12 22:58

QDialog, how to detect when user clicks background window?
 
I got a QMainWindow, and from that i run a QDialog named MyDialog and when MyDialog is displayed and a user clicks the backgroun main window, the QDialog is destroyed or something.. how can i detect that ?

I have tried this:
connect(MyDialog,SIGNAL(destroyed()),process,SLOT( stop()));

But it does not work..

Any ideas?

timoph 2010-02-13 08:04

Re: QDialog, how to detect when user clicks background window?
 
I'm not sure about your problem but you could use QDialog's finished signal or reimplement closeEvent.

Edit: Been doing too much desktop applications lately => Removed incorrect advice :)

tmsha 2010-02-13 13:08

Re: QDialog, how to detect when user clicks background window?
 
Thank you, but the finish signal does not work. I dont want to reimplement anything, I just want a simple dialog with some user input.

nilsbenson 2010-02-15 05:40

Re: QDialog, how to detect when user clicks background window?
 
The dialog gets disposed of with a DialogCode of None if you tap on the background form when a modal QDialog is being displayed.

You have to handle accept() / reject() yourself from whatever buttons are on your form. When the background is clicked it is being "canceled" without being rejected.


All times are GMT. The time now is 14:10.

vBulletin® Version 3.8.8