PDA

View Full Version : Qt Designer Unable to Add Layout in DocWidget/tabwidget.



akash
15th September 2011, 11:46
Hi,

Could you please help to resolve below issue.

I copied DocWidget code from Qt graphicView ex-tranformation example in my program. It is working fine.
But when i tried to drag a new DocWidget in my UI (in designer), i found that there is a difference between the DocWidget that i copied from the example and the one that i dragged in my UI.

Refering: DocWidget from example as: exDocWidget
dragged DocWidget as: myDocWidget


Problem: In exDocWidget there is a default layout called docWidgetContents of class type QWidget. in this layout I placed a treeWidget and it was placed easily and resized itself accordingly.
But, when i dragged myDocWidget, I also got default layout called docWidgetContents_2 of class type QWidget, but there was a prohibition sign placed on the layout symbol.(Please find the screen shot for reference). Inside myDocWidget i placed another treeWidget, but this time the size of treeWidget didnt changed as per the myDocWidget size.

Could you please help me in solving this issue.
I want place a new docWidget in my UI and in this docWidget i want to place a treeWidget that can change its size according to the docWidget at design time as well as at runtime.

*is there any property that need to be changed.

Thanks for your attention.

thanks,
Akash

akash
16th September 2011, 07:57
Hi,

Problem Resolved.
I dont know whether this solution is appropriate or not.
Correct me if i m wrong.

To reslve this issue i manually insert the below code in xml file under each container widget like tabwidget and docwidget.

<layout class="QVBoxLayout" name="verticalLayout_tab1">
<item>

</item>
</layout>
*let me know if there is any alternate solution that can solve this problem automatically while designing the UI in Qt Design.
Thanks,
akash