Angus Leeming wrote:
> 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!
> 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.
I don't think this is the cause. Do this: Open a new file; put in a
listings include. Now open the include dialog and, after it opens, hit
escape. Click on the listings inset, enter some text into the caption
field, and hit return. This will work: OK is still the default button.
Now open the include dialog again and do nothing but hit "Close". Now OK
is not the default button. This seems to be caused by the tour through
ButtonPolicies.cpp. But I do not understand that code.

Richard
>
> 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);
>>  }
>>  
>>  
>>


-- 
==================================================================
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==================================================================
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto

Reply via email to