Click here to Skip to main content
16,004,647 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

on a QDialog I have a QPushButton. I then use
QPushButton::setDefault( TRUE 
)
so that "the push button will be pressed if the user hits the Enter key in
a dialog". In this scenario it is working.

But in case if i keep QPushButton on QWidget and then set
QPushButton::setDefault( TRUE).
On hitting keyboard enter button nothing happens. Why?

Can someone please answer this and also can suggest me the solution.

Thanks in advance
Posted
Updated 13-Feb-12 1:44am
v2
Comments
Rajesh Anuhya 13-Feb-12 7:44am    
Edited: "Treat my content as plain text, not as HTML" checkbox disabled.
--RA
Sergey Alexandrovich Kryukov 13-Feb-12 11:31am    
The two code samples are identical...
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900