Results 1 to 4 of 4

Thread: addWidget other place than setCentralWidget()

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2007
    Location
    Lake Forest, CA, USA
    Posts
    132
    Thanks
    10
    Thanked 27 Times in 22 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: addWidget other place than setCentralWidget()

    1. BTW, create all widgets in visual editor, it's much easier.
    2. Add layout to your tab
    Qt Code:
    1. tab->setLayout(new QVBoxLayout());
    To copy to clipboard, switch view to plain text mode 
    3. Add QPushButton and QGroupBox to that layout
    Qt Code:
    1. tab->layout()->addWidget(new QPushButton());
    2. tab->layout()->addWidget(newGB);
    To copy to clipboard, switch view to plain text mode 
    Oleg Shparber

  2. The following user says thank you to Oleg for this useful post:

    darkrptyp (19th November 2011)

Similar Threads

  1. Replies: 1
    Last Post: 19th March 2011, 10:57
  2. setCentralWidget problems
    By tlerner in forum Qt Programming
    Replies: 2
    Last Post: 19th October 2009, 21:26
  3. QGraphicsScene::addWidget on MAC OS X 10.5.8
    By marcomas in forum Qt Programming
    Replies: 4
    Last Post: 23rd August 2009, 19:37
  4. QStatusBar::addWidget() without Frame
    By Lykurg in forum Newbie
    Replies: 2
    Last Post: 25th April 2006, 13:46
  5. addWidget in qWidgetStack
    By mickey in forum Newbie
    Replies: 7
    Last Post: 3rd March 2006, 21:09

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.