hello , everyone.Can i use Qt::Key_Left , Qt::Key_Up , Qt::Key_Right and Qt::Key_Down to implement tab order function???
hello , everyone.Can i use Qt::Key_Left , Qt::Key_Up , Qt::Key_Right and Qt::Key_Down to implement tab order function???
You have my permission
what???what??
I sorry about my english . I mean that I don't want to use tab key ,and use Key_Left , Key_Up, Key_Right,Key_Down to implement the same function as tab key . Can anyone tell me how to do that?
The easiest way is to create QAccel and tie it to a custom slot and invoke QWidget::focusNextChild() or QWidget::focusPreviousChild() from it, but probably you want more.
Other solution is to install an event filter using QObject::installEventFilter() and check if you caught the right QKeyEvent and invoke QWidget::setFocus().
Hello , jacek . Can you some examples about the above two solutions ?my e-mail is:
hesummar@126.com .. Thank you
You can find an example in QObject::installEventFilter() docs. All you have to do is to check what key was pressed and invoke setFocus().
What exactly should happen if for example user presses Key_Up?
jacek,Thank you ,because my work is to develop a program for a machine , and the machine's keyboard doesn't have an key_tab key. but I found an example in <<c++ gui design with qt3>> .
Bookmarks