void vc_widget::keyPressEvent(QKeyEvent *ev) { if (ev->key() == Qt::Key_Up) { qDebug() << "press key up"; return; } if (ev->key() == Qt::Key_Down) { qDebug() << "press key down"; return; } if (ev->key() == Qt::Key_Left) { qDebug() << "press key left"; return; } if (ev->key() == Qt::Key_Right) { qDebug() << "press key right"; return; } }