I have a parent class which contain scene and view objects.
When I choose a rectangle for zooming I emit a signal which is connected to parent slot.
SIGNAL:
emit vSignalZoomRectangle(m_zoomPolygonItem->boundingRect());
//m_zoom PolygonItem is a QPolygonItem created in the scene coordinates(the rect for zooming)
emit vSignalZoomRectangle(m_zoomPolygonItem->boundingRect());
//m_zoom PolygonItem is a QPolygonItem created in the scene coordinates(the rect for zooming)
To copy to clipboard, switch view to plain text mode
SLOT:
void MyClass
::vZoomSceneRectangle(QRectF _rectangle
) {
m_view->fitInView(_rectangle,Qt::KeepAspectRatio);
//m_view->ensureVisible(_rectangle);
void MyClass::vZoomSceneRectangle(QRectF _rectangle)
{
m_view->fitInView(_rectangle,Qt::KeepAspectRatio);
//m_view->ensureVisible(_rectangle);
To copy to clipboard, switch view to plain text mode
the connection is ok, and the correct rectF is passed, but no matter the rect coordinates the first zooming in ans other zoom the scene center point.
?
Bookmarks