Thread: NAV preference?
View Single Post
Old Yesterday, 05:48 PM   #17
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 10,256
Karma: 7640672
Join Date: Nov 2009
Device: many
Since no text input is needed in that dialog, I mapped pushbuttons to the keyboard as shown below (think Down, Up, First, Last).

Code:
bool EditRO::eventFilter(QObject *obj, QEvent *event)
{
    if (obj == ui.ROList) {
        if (event->type() == QEvent::KeyPress) {
            QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
            int key = keyEvent->key();

            if (key == Qt::Key_D) {
                MoveDown();
                return true;
            } else if (key == Qt::Key_U) {
                MoveUp();
                return true;
            } else if (key == Qt::Key_F) {
                ToTop();
                return true;
            } else if (key == Qt::Key_L) {
                ToBottom();
                return true;
            }
        }
    }
    // pass the event on to the parent class
    return QDialog::eventFilter(obj, event);
}
KevinH is offline   Reply With Quote