Hi,
I have na idea where the problem lays(I suppose that wysote suggested it at the beginning in the first place, but didn't understand the idea). I belive the problem is connected with scene/view sizes.
Here is the information about the view/scene sizes after construction and their sizes while doing the first zooming.
Just after construction:
qDebug()<<m_view->size().height()<<m_view->size().width();
m_scene->setSceneRect(-50,50,m_view->width(),m_view->height());
qDebug()<<m_scene->sceneRect().height()<<m_scene->sceneRect().width();
qDebug()<<m_view->size().height()<<m_view->size().width();
m_scene->setSceneRect(-50,50,m_view->width(),m_view->height());
qDebug()<<m_scene->sceneRect().height()<<m_scene->sceneRect().width();
To copy to clipboard, switch view to plain text mode
Before doing the first zooming :
qDebug()<<m_view->size().height()<<m_view->size().width();
qDebug()<<m_scene->sceneRect().height()<<m_scene->sceneRect().width();
qDebug()<<m_view->size().height()<<m_view->size().width();
qDebug()<<m_scene->sceneRect().height()<<m_scene->sceneRect().width();
To copy to clipboard, switch view to plain text mode
I would like to have the same coordinate system in the scene and the view. It looks like because of the scene/view size different the zooming is incorrect. Am I right?
Because the first zooming rectangle(from my example zooming) has coordinates:
-285 157
215 157
-285 -143
215 -143
and it's bigger than the scene, so I zoom the whole(the center).
Ok...I belive this is the problem, but yet do not know how to fix it ?
Any help appreciated.
Maverick
Bookmarks