PDA

View Full Version : Resizing of layout on adding a new graphicsview to the existing layout



anupama
12th December 2010, 06:09
Hi,

I am adding a new declarative component to the existing graphics view after clearing the previous declarative component.

I am following the below steps:

mHBoxTopLayout.addStretch(70);
mHBoxTopLayout.addWidget(&mNumFilesIndicatorButton);

mGraphicsScene.addItem(qmlComponent);
mGraphicsView.setScene(&mGraphicsScene);
mHBoxMiddleLayout.addWidget(&mQmlInfoLabel);
mHBoxMiddleLayout.addWidget(&mGraphicsView);
mVBoxLayout.addLayout(&mHBoxTopLayout);
mVBoxLayout.addLayout(&mHBoxMiddleLayout);

Next on click of a NumFilesButton, I need to change the qmlComponent which is of the different size.
When i remove the item from the scene and add to graphics view, a scroll bar gets added in the view instead of the whole layout resizing.

Attached is the actual qml files and the widget in which the qml files are added by using graphicsview.

Do i need to delete the layout and recreate the layouts again or is there a mechanism to resize the layouts dynamically ?

Thanks,
Anupama