pmohod
2nd July 2010, 08:00
Dear all,
I am using Qt-4.6.2 in my application.
I have created a class(ImgMatchTex) inherited from QGLWidget.
Now when I am using QCursor::setPos(int, int) function to set the cursor position.
But after using it, it is giving a problem while resizing the window.
I am not able to increase the height of the window. Event->size().height() remains to constant(zero) even if I try to increase the window height,
and this is due to QCursor::setPos(int, int) function. When I comment this line , it works fine.
Could anyone know reason behind such a abnormal behaviour.
void ImgMatchTex::resizeEvent (QResizeEvent *Event) // Derived form QGLWidget.
{
makeOverlayCurrent();
resizeOverlayGL (Event->size().width(), Event->size().height() );
makeCurrent();
resizeGL (Event->size().width(), Event->size().height() );
QPoint GWinCent = mapToGlobal (QPoint(width()/2, height()/2));
QCursor::setPos (GWinCent.x(), GWinCent.y());
}
I am using Qt-4.6.2 in my application.
I have created a class(ImgMatchTex) inherited from QGLWidget.
Now when I am using QCursor::setPos(int, int) function to set the cursor position.
But after using it, it is giving a problem while resizing the window.
I am not able to increase the height of the window. Event->size().height() remains to constant(zero) even if I try to increase the window height,
and this is due to QCursor::setPos(int, int) function. When I comment this line , it works fine.
Could anyone know reason behind such a abnormal behaviour.
void ImgMatchTex::resizeEvent (QResizeEvent *Event) // Derived form QGLWidget.
{
makeOverlayCurrent();
resizeOverlayGL (Event->size().width(), Event->size().height() );
makeCurrent();
resizeGL (Event->size().width(), Event->size().height() );
QPoint GWinCent = mapToGlobal (QPoint(width()/2, height()/2));
QCursor::setPos (GWinCent.x(), GWinCent.y());
}