Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, August 2007
Re: QDialog, QPushButton and editable QCombobox


Message 1 in thread

Did you ever get an answer for this?  I'm seeing the same issue...

On 6/30/07, Thorvald Natvig <thorvald@xxxxxxxxxx> wrote:
> I have a small nuisance with QDialog on Qt 4.3 OpenSource, mingw on WinXP.
>
> If you add some QPushButtons to a QDialog, it seems to automatically
> choose one as the default button. This is fine.
>
> However, my dialog also has a editable QComboBox. To update the entry,
> the user types in new text and presses enter. This causes activated() to
> be emitted, but the same enter press also causes the default button to
> be pressed. Is there a way to get qcombobox (or more likely the
> underlying qlineedit) to consume the enter press so the default button
> doesn't trigger?
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>

--
 [ signature omitted ] 

Message 2 in thread

A couple of things come to mind that you could do:
1) For each pushbutton that you add, call ::setDefault(false), on the 
button.
2) Subclass QComboBox and consume the <enter> keypress in keyPressEvent 
(probably the better choice)

HTH & good luck,
Susan

Kirby Frugia wrote:
> Did you ever get an answer for this?  I'm seeing the same issue...
>
> On 6/30/07, Thorvald Natvig <thorvald@xxxxxxxxxx> wrote:
>   
>> I have a small nuisance with QDialog on Qt 4.3 OpenSource, mingw on WinXP.
>>
>> If you add some QPushButtons to a QDialog, it seems to automatically
>> choose one as the default button. This is fine.
>>
>> However, my dialog also has a editable QComboBox. To update the entry,
>> the user types in new text and presses enter. This causes activated() to
>> be emitted, but the same enter press also causes the default button to
>> be pressed. Is there a way to get qcombobox (or more likely the
>> underlying qlineedit) to consume the enter press so the default button
>> doesn't trigger?
>>
>> --
>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
>> List archive and information: http://lists.trolltech.com/qt-interest/
>>
>>
>>     
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>
>   


---

This communication contains confidential information. If you are not the intended recipient please return this email to the sender and delete it from your records.

Diese Nachricht enthält vertrauliche Informationen. Sollten Sie nicht der beabsichtigte Empfänger dieser E-mail sein, senden Sie bitte diese an den Absender zurück und löschen Sie die E-mail aus Ihrem System.


Message 3 in thread

Ok.

On 8/8/07, Susan Macchia <qt-list@xxxxxxxxxxxxx> wrote:
> A couple of things come to mind that you could do:
> 1) For each pushbutton that you add, call ::setDefault(false), on the
> button.
> 2) Subclass QComboBox and consume the <enter> keypress in keyPressEvent
> (probably the better choice)
>
> HTH & good luck,
> Susan
>
> Kirby Frugia wrote:
> Did you ever get an answer for this? I'm seeing the same issue...

On
> 6/30/07, Thorvald Natvig <thorvald@xxxxxxxxxx> wrote:

> I have a small nuisance with QDialog on Qt 4.3 OpenSource, mingw on
> WinXP.

If you add some QPushButtons to a QDialog, it seems to
> automatically
choose one as the default button. This is fine.

However, my
> dialog also has a editable QComboBox. To update the entry,
the user types in
> new text and presses enter. This causes activated() to
be emitted, but the
> same enter press also causes the default button to
be pressed. Is there a
> way to get qcombobox (or more likely the
underlying qlineedit) to consume
> the enter press so the default button
doesn't trigger?

--
 [ signature omitted ]