I am moving my graphics engine from Freeglut to Qt. My window class inherits from QWindow. I have a problem setting the relative position of the mouse in the center of the window and hiding the cursor. In freeglut, the code looks like this:
glutWarpPointer((glutGet(GLUT_WINDOW_WIDTH) / 2), (glutGet(GLUT_WINDOW_HEIGHT) / 2));
glutSetCursor(GLUT_CURSOR_NONE);
I tried something like this:
this->cursor().setPos((width() / 2), (height() / 2));
this->cursor().setShape(Qt::BlankCursor);
How to do it?
Irbis source
share