![]() |
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? |
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 :) |
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.
|
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