Richard Heck wrote:
I've discovered a problem with my fix for bug 3461, at changeset 17920.
The problem there was that the dialog needed to be reset when it was
closed by hitting the cancel button. What I've realized is that the same
problem arises with the escape button: Hitting escape does not trigger
slotClose(), and it does not trigger a closeEvent(), either. It's easy
enough to deal with this by connecting rejected() to something
appropriate. The first question is to what it should be connected, and
whether it should be connected to slotClose(). The second question is
whether this is a more general problem. Should ESC be connected to
slotClose() elsewhere?
Isn't this QDialogView::slotRestore() you are looking for?
if so, should this be done in some more general
manner?
Maybe yes but don't forget that "Cancel" is usually for cancelling ;-)
If you want to do that, that would be QDialogView::slotOK(). But I think
it is better to restore the state before cancelling; and that is done by
Dialog::RestoreButton().
Quite convoluted...
Abdel.