Results 1 to 4 of 4

Thread: How to do that?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    5
    Thanked 86 Times in 81 Posts

    Default Re: How to do that?

    Quote Originally Posted by conexion2000
    Here is sample:


    So I would like to do something similar. As You can see there is some QGroupBox with 3 horizontal QLayouts in it. These layouts contains some widgets. And here appears my problem. How to put these layouts inside this groupbox. Setting QGroupBox as a parent doesn't seem to work, because debug functions say that QGroupBox already have a layout. When I do that in a "traditional way" (creating QLayout with QGroupBox as a parent) these widgets don't show in program.
    Please help.
    You must use QWidget::setLayout.

    Qt Code:
    1. lay1->addWidget(wgt1_1);
    2. ...
    3. lay1->addWidget(wgt1_N);
    4.  
    5. ..........
    6.  
    7. layN->addWidget(wgtN_1);
    8. ...
    9. layN->addWidget(wgtN_N);
    10.  
    11. v->addLayout(lay1);
    12. ...
    13. v->addLayout(layN);
    14.  
    15. grpBox->setLayout(v)
    To copy to clipboard, switch view to plain text mode 

    where wgtX_X are widget to add and grpBox are your QGroupBox.
    A camel can go 14 days without drink,
    I can't!!!

  2. #2
    Join Date
    Mar 2006
    Posts
    17
    Thanks
    4

    Default Re: How to do that?

    Problem solved thanks to your code zlatko.

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.