I am trying to implement wheel event in Ogre Render window embedded in QWidget. I am modifying the example of QOgreWidget available at: http://github.com/gklingler/QOgreWidget.
It has a zoom function as:
void QOgreWidgetDemo::onZoomIn() {
mCamera->moveRelative(Ogre::Vector3(0, 0, -10.0));
}
void QOgreWidgetDemo::onZoomIn() {
mCamera->moveRelative(Ogre::Vector3(0, 0, -10.0));
}
To copy to clipboard, switch view to plain text mode
I want to implement it using QWheelEvent. I have modified it to:
qDebug() << "Wheel event";
if(event->delta > 0){
mCamera->moveRelative(Ogre::Vector3(0, 0, -10.0));
}
}
void QOgreWidgetDemo::onZoomIn(QWheelEvent *event) {
qDebug() << "Wheel event";
if(event->delta > 0){
mCamera->moveRelative(Ogre::Vector3(0, 0, -10.0));
}
}
To copy to clipboard, switch view to plain text mode
This is not working. How should I proceed to implement wheel event in the Render Window?
Thanks in advance.
Bookmarks