Results 1 to 2 of 2

Thread: QToolBox, how to set layout to item

  1. #1
    Join Date
    Oct 2009
    Location
    Russia, South Ural, Chelyabinsk
    Posts
    42
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QToolBox, how to set layout to item

    Hi!

    QToolBox *box = new QToolBox(this);

    QWidget *wgt = new QWidget();

    toolbox->addItem(wgt, "New tab");

    How to add QVBoxLayout to item?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QToolBox, how to set layout to item

    Quote Originally Posted by sergey_85 View Post
    How to add QVBoxLayout to item?
    Normal like any other widget:
    Qt Code:
    1. QToolBox *box = new QToolBox(this);
    2.  
    3. QWidget *wgt = new QWidget();
    4. wgt->setLayout(...);
    5.  
    6. toolbox->addItem(wgt, "New tab");
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to Lykurg for this useful post:

    sergey_85 (30th November 2009)

Similar Threads

  1. How to resize a layout item?
    By lni in forum Qt Programming
    Replies: 3
    Last Post: 22nd February 2009, 08:53
  2. View, Scene, Item and thread??
    By dungsivn in forum Qt Programming
    Replies: 5
    Last Post: 20th August 2008, 19:21
  3. Item Delegate Painting
    By stevey in forum Qt Programming
    Replies: 3
    Last Post: 9th May 2008, 07:37
  4. Replies: 3
    Last Post: 4th April 2008, 19:51
  5. Qt layout memory issue
    By bunjee in forum Qt Programming
    Replies: 9
    Last Post: 25th August 2007, 17:11

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.