Richard Heck wrote:
For some reason, changing the type of the dialog switches the default
button from OK to Cancel. This restores the correct default. Must be a
QT bug.

Still seeking two OKs...or at least some reaction!

Hi, Richard.

The button is changed because the GUI view is telling the ButtonController that the state of one of the widgets has changed. That's because listingsGB is emitting a signal when its own state is changed and this signal is connected to some slot that contains code to communicate the change of state to the ButtonController.

So, the correct fix would be one of:
1. tell listingsGB not to emit that signal. There's code elsewhere in the qt4 dialog where some widget is temporarily silenced like that. 2. Does listingsGB need to be connected to a slot at all? If not, then the correct fix would be to remove this connection. Voilà! no more Cancel!

Angus

------------------------------------------------------------------------

Index: QInclude.cpp
===================================================================
--- QInclude.cpp        (revision 18522)
+++ QInclude.cpp        (working copy)
@@ -110,6 +110,7 @@
 }
+//I think it's in here that the weird return behavior is being caused. Somehow.
 void QIncludeDialog::typeChanged(int v)
 {
        switch (v) {
@@ -143,6 +144,8 @@
                        listingsGB->setEnabled(false);
                        break;
        }
+       //This shouldn't be necessary, but it is.
+       okPB->setDefault(true);
 }

Reply via email to