QProgressDialog: remove cancel button doesn't remove key handling of cancel button?
-
wrote on 11 Mar 2019, 03:25 last edited by
I have a progress dialog on startup, showing, well ... startup progress.
there isn't a cancel buttton cuz i removed it (setCancelButton(NULL))
however, hitting esc, cmd-., ctrl-c causes the dialog to dismiss itself.
without overriding this dialog, how do i disable that?
:)
-
wrote on 11 Mar 2019, 19:22 last edited by
Install an event filter and check for the close event.
This worked!! Thanks!!
-
wrote on 11 Mar 2019, 04:38 last edited by
according to this topic, i tried this:
disconnect(this, SIGNAL(canceled()), this, SLOT(cancel()));
yet the escape key STILL cancels the dialog. ??
-
Derive from QProcessDialog and override the closeEvent()
-
wrote on 11 Mar 2019, 06:14 last edited by
quote:
without overriding this dialog, how do i disable that?
if there isn't any way to do it without overriding, then there you have it.
But i was wondering if there IS in fact a way?
-
There are basically two ways to deal with events - overriding and event filters. Since you don't want to override you're left with the latter. Install an event filter and check for the close event.
-
wrote on 11 Mar 2019, 19:22 last edited by
Install an event filter and check for the close event.
This worked!! Thanks!!
1/6