- } else if ((watched == m_itemView) && (event->type() == QEvent::KeyPress)) {
- const int key = static_cast<QKeyEvent*>(event)->key();
- const bool arrowKeyPressed = (key == Qt::Key_Up) || (key == Qt::Key_Down) ||
- (key == Qt::Key_Left) || (key == Qt::Key_Right);
- if (arrowKeyPressed) {
- QMetaObject::invokeMethod(this, "scrollToCurrentIndex", Qt::QueuedConnection);
- }
- }
-