jano_alex_es
24th November 2009, 15:46
Hi,
in my scene I use to have a lot of removable items, so most of times the scene is bigger than expected, way more sometimes.
I want to solve this by updating, by code, its size qhen the user presses a button.
I'm doing:
QRectF itemRec = m_pSkScene->itemsBoundingRect();
m_pSkScene->setSceneRect(itemRec);
//m_pSkScene.views().at(0)->setSceneRect(itemRec);
ui.graphicsView->setSceneRect(itemRec);
it resizes right, but when an item goes out the scroll bar doesn't appears as before. Setting "scrollBarAlwaysOn" doesn't solve it.
any idea? thanks!
in my scene I use to have a lot of removable items, so most of times the scene is bigger than expected, way more sometimes.
I want to solve this by updating, by code, its size qhen the user presses a button.
I'm doing:
QRectF itemRec = m_pSkScene->itemsBoundingRect();
m_pSkScene->setSceneRect(itemRec);
//m_pSkScene.views().at(0)->setSceneRect(itemRec);
ui.graphicsView->setSceneRect(itemRec);
it resizes right, but when an item goes out the scroll bar doesn't appears as before. Setting "scrollBarAlwaysOn" doesn't solve it.
any idea? thanks!