Results 1 to 2 of 2

Thread: Unable to Add Layout in DocWidget/tabwidget.

  1. #1
    Join Date
    Aug 2011
    Location
    Pune, India
    Posts
    18
    Qt products
    Qt4
    Platforms
    Windows

    Default Unable to Add Layout in DocWidget/tabwidget.

    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
    Attached Images Attached Images

  2. #2
    Join Date
    Aug 2011
    Location
    Pune, India
    Posts
    18
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Unable to Add Layout in DocWidget/tabwidget.

    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.
    Qt Code:
    1. <layout class="QVBoxLayout" name="verticalLayout_tab1">
    2. <item>
    3.  
    4. </item>
    5. </layout>
    To copy to clipboard, switch view to plain text mode 
    *let me know if there is any alternate solution that can solve this problem automatically while designing the UI in Qt Design.
    Thanks,
    akash

Similar Threads

  1. Replies: 0
    Last Post: 22nd July 2011, 11:31
  2. Replies: 0
    Last Post: 12th December 2010, 05:09
  3. tabWidget in Designer
    By ShamusVW in forum Newbie
    Replies: 1
    Last Post: 10th August 2010, 09:21
  4. Replies: 0
    Last Post: 25th May 2009, 10:00
  5. TabWidget
    By Salazaar in forum Newbie
    Replies: 5
    Last Post: 17th May 2007, 21:07

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.