Alles rund um die Programmierung mit Qt
-
silvia
Beitrag
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
-
FlorianBecker
- Beiträge: 1213
- Registriert: 2. Dezember 2004 10:54
-
Kontaktdaten:
Beitrag
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.