views:

128

answers:

1

Hi,

I have created a dialog using qt designer. There is a QLineEdit object in the dialog with some default content. When dialog initializes focus goes to the QLineEdit, I want the default content to be auto selected so once user start writing previous content will be overwritten.

Thanks, GG

[EDIT]
{ in constructor }

dialog->accept(); 
and
connect( dialog, SIGNAL(accepted()), QlineObj, SLOT( selectAll() ) );

A: 

Call

lineEdit->selectAll();

after you set the default text. (In the dialog constructor, perhaps.)

andref
Thanks I already did it ;)dialog->accept(); { in constructor }andconnect( dialog, SIGNAL(accepted()), QlineObj, SLOT( selectAll() ) );
GG