Seite 1 von 1

lineedit und focus

Verfasst: 5. Mai 2005 13:23
von silvia
Hallo, i have a lineedit.
I want a default value = "Type here". And if the focus is true than value = empty.

Can somebody help me?


thanks

Verfasst: 6. Mai 2005 19:44
von FlorianBecker
Hi, so reimplement the focusEvent Memeber(s) and do something like this:

enterFocusEvent( QEvent * ) {

lineEdit -> setText( "" );
or:
lineEdit -> clear();
}

and maybe you also want to reimplement the leaveFocusEvent to setup the default Text again.

Hope that'll help you.