[kde-edu]: kbruch UI

Jason Harris kstars at 30doradus.org
Sun Oct 31 18:45:34 CET 2004


Hello,

On Sunday 31 October 2004 08:28 am, Anne-Marie Mahfouf wrote:
> the ENTER key is intuitive in a field t validate the value you enter
> it also appears to me intuitive that after Enter it jumps at the
> other field
>
I agree, and it's pretty easy to do.  Just make a slotAdvanceFocus() 
Slot, and attach it to the returnPressed() Signal of each line edit.
The slot will look something like this:

void KBruch::slotAdvanceFocus(void) {
 if ( sender()->name() == QString( "editBox1" ) ) editBox2->setFocus();
 if ( sender()->name() == QString( "editBox2" ) ) editBox3->setFocus();
 if ( sender()->name() == QString( "editBox3" ) ) processEntry();
}

(or whatever is supposed to happen after all boxes are filled...)

Jason
-- 
KStars: A KDE Planetarium
http://edu.kde.org/kstars


More information about the kde-edu mailing list