I have a QGraphicsView class with a QGraphicsScene.
In the scene I add items, much like in a ListView. When the number of items exceed what will fit in the view, scrollbars appear much like they should. Behavior is exactly what I want at this point.
When items are removed from the scene so that all of the remaining items are visible in the list, the scrollbars are still there.
Shouldn't the scrollbars disappear when not needed? I can use the scrollbars to scroll to the bottom of the scene (where the scene was previosly pupulated with items), but there are no items at the bottom anymore because they were previously removed, so the scene should resize and the scrolbars disappear.
for (int index = 0; i <= itemsInList(); index++)
{
m_scene->addItem( myItem[index]) ;
}
for (int index = 0; i <= itemsInList(); index++)
{
if ( myItem[index]->isSelected() )
{
m_scene->removeItem( myItem[index] );
}
}
for (int index = 0; i <= itemsInList(); index++)
{
m_scene->addItem( myItem[index]) ;
}
for (int index = 0; i <= itemsInList(); index++)
{
if ( myItem[index]->isSelected() )
{
m_scene->removeItem( myItem[index] );
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks