Results 1 to 3 of 3

Thread: Adding QGroupBox to QTabWidget

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Adding QGroupBox to QTabWidget

    You don't have to pass anything there. Just create your tab widget and set it as the central widget. You shouldn't touch setupUi() at all.

    Qt Code:
    1. MyWindow::MyWindow(QWidget *parent) : QMainWindow(parent){
    2. ui.setupUi(this);
    3. QTabWidget *tw = new QTabWidget(this);
    4. setCentralWidget(tw);
    5. QGroupBox *gb1 = new QGroupBox(tw);
    6. tw->addPage(gb1, "first");
    7. QHBoxLayout *l = new QHBoxLayout(gb1);
    8. DMXTable *t1 = new DMXTable;
    9. l->addWidget(t1);
    10. //...
    11. }
    To copy to clipboard, switch view to plain text mode 

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

    mclark (17th January 2007)

Similar Threads

  1. QTabWidget Placement and Display
    By mclark in forum Newbie
    Replies: 1
    Last Post: 16th January 2007, 20:34
  2. QGroupBox Issues
    By ToddAtWSU in forum Qt Programming
    Replies: 8
    Last Post: 16th January 2007, 13:45
  3. Adding buttons on the tab part of a tabwidget
    By forrestfsu in forum Qt Programming
    Replies: 2
    Last Post: 20th December 2006, 17:52
  4. QGroupBox title truncated on both sides
    By Gopala Krishna in forum Qt Programming
    Replies: 2
    Last Post: 7th October 2006, 15:02
  5. Dynamically adding tabs
    By larry104 in forum Qt Programming
    Replies: 7
    Last Post: 26th July 2006, 20:27

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.