jqt will setAutoDefault(true) for the default button. but I am not
sure if setDefault(true) should be used instead (I'm too slow to
understand the documentation).  Also the parent form in jqt is not a
QDialog, instead it is a top level QWidget without any parent, so I
don't know if default button can apply.

IIRC the problem with form_enter in jqt is that it is always triggered
whenever an Enter key has been pressed, no matter the child control
had processed it or not.  If you examine the event log, you might
notice this.


On Fri, May 29, 2015 at 3:06 PM, 'Pascal Jasmin' via General
<[email protected]> wrote:
> http://stackoverflow.com/questions/11887938/how-to-make-a-qpushbutton-pressable-for-enter-key
>
> default in qt is supposed to make a button (intended behaviour) respond to 
> form_enter as well.  When I add that property though, it disables the code 
> behind the button (it in fact erases the button handler from the form), 
> though the wdq list looks the same. (the button no longer responds to mouse 
> clicks, and still doesn't react to enter key)
>
> Perhaps it is a relatively easy fix to avoid erasing the button handler.  I 
> can add it after the form is created, but I seem to have trouble getting the 
> locales right.
>
>
> ----- Original Message -----
> From: bill lam <[email protected]>
> To: General forum <[email protected]>
> Cc:
> Sent: Friday, May 29, 2015 12:57 AM
> Subject: Re: [Jgeneral] wd button default
>
> there was a form_enter event in j602 which should be what you want, but it
> is difficult to duplicate in j803.
>
> there may be some bug in default button or it is the behavior under Qt.  I
> am not sure because I have never used default button (j6 or j8).
>
> I would suggest not to depend on these features (form_enter or default
> button).
> On May 29, 2015 12:13 PM, "'Pascal Jasmin' via General" <
> [email protected]> wrote:
>
>> thanks Chris,
>>
>> I don't see anything useful happening as a result of adding a default
>> property to a button.
>>
>> I can see that defining a __default function does intercept keystrokes in
>> 'sysdata' but the enter key does not get "captured" (though backspace
>> does).  Strangely, pressing the enter key repeats the last key that was in
>> sysdata.
>>
>> Is there a recommended way to tell if the enter key has been pressed?
>>
>>
>>
>>
>> ----- Original Message -----
>> From: chris burke <[email protected]>
>> To: General forum <[email protected]>
>> Cc:
>> Sent: Thursday, May 28, 2015 9:51 PM
>> Subject: Re: [Jgeneral] wd button default
>>
>> Usually you want to handle wd events. Use showevents_jqtide_ to display the
>> events in the session. If displaying wdq, note that the first 3 rows show
>> the event handlers. These are searched in order and the first one found
>> will be executed.
>>
>> Escclose simply means that pressing Esc will signal a cancel event. If you
>> also set closeok on the parent, then pressing Esc will close the form
>> without an event, for example the image form in the Qt demos has this
>> property.
>>
>>
>> On 28 May 2015 at 14:52, 'Pascal Jasmin' via General <
>> [email protected]>
>> wrote:
>>
>> > I don't think that the 'button default' command works or works sensibly.
>> > In the jqt controls demo, neiter escape nor enter closes the form despite
>> > the cancel button having the default property set, and escclose is also
>> set
>> > on the form.
>> >
>> > From peeking at wdq, it appears as though I might need to create a verb
>> > called default for my form?
>> >
>> > How I expect it to work.... pressing enter while on a control that is not
>> > multiline edit, should execute the code already assigned to the button
>> > marked as default.  ideally, the escclose property should be attachable
>> to
>> > a button, and pressing escape runs the same code that clicking on the
>> > "cancel" button would do.
>> > ----------------------------------------------------------------------
>> > For information about J forums see http://www.jsoftware.com/forums.htm
>
>>
>> >
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to