Quote:
OK, making progress. The problem is in GLWidget::mouseMoveEvent(), and is triggered by the QCursor::setPos() call on line 548. it looks like the setPos call on Mac generates a mouse movement event, which crashes since you are already handling a movement event...
That's interessting. Seems to be logical since you have pressed the mouse button and so it should be send an event to the widget. I'm wondering why the same problem does not occure under windows or linux.
You may try if the following suggestion fixes the problem:
Include Qt/qapplication.h in GLWidget.cpp
Code:
#include <Qt/qapplication.h>
then in mouseMoveEvent change the code to the following:
Code:
void GLWidget::mouseMoveEvent(QMouseEvent* event)
{
static bool ignoreEvents = false;
if (ignoreEvents)
{
event->accept();
return;
}
// jump back to screen center if we want to transform the camera
if (m_transformationMode == None)
{
QPoint centerPos(mapToGlobal(frameGeometry().center()));
float diffX = event->globalX() - centerPos.x();
float diffY = event->globalY() - centerPos.y();
ignoreEvents = true;
QCursor::setPos(centerPos);
QApplication::processEvents();
ignoreEvents = false;
if (m_controlPressed) // Strafe
cameraNavigation(diffX * (m_navSpeed / 100), diffY * (m_navSpeed / 100), 0, 0, 0);
else // Rotate Camera
cameraNavigation(0, 0, 0, diffX * (m_navSpeed / 100), diffY * (m_navSpeed / 100));
}
// Move object
else if (m_transformationMode == MoveObject)
translateObject(event->x(), (height() - event->y()));
// Rotate Object
else if (m_transformationMode == RotateObject)
rotateObject(event->x(), height() - event->y());
// Scale Object
else if (m_transformationMode == ScaleObject)
scaleObject(event->x(), height() - event->y());
event->accept();
}
It's some kind of hack, if someone has a better solution, feel free to post it.