I'm learning 3D using Qt and got a problem. I'm analyzing example: https://doc.qt.io/qt-5/qt3d-basicshapes-cpp-example.html
and now I wanted to modify it: when user presses a key (let's say 'w') something is moving (or just debug print at this stage). I tried to write a keyPressEvent
function but I have no effect. Shall I do it in different way than in standard 2D app?
void SceneModifier::keyPressEvent(QKeyEvent *event)
{
switch(event->key())
{
case Qt::Key_W:
{
qDebug()<<"Key is pressed";
break;
}
default:
break;
}
}
Cheers, Mikolaj