Results 1 to 3 of 3

Thread: add a label in a QTabWidget

  1. #1
    Join Date
    Jul 2007
    Posts
    166
    Thanks
    25
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default add a label in a QTabWidget

    Hi,
    I have a mainwindow and a QTabWidget in that window. The QTabWidget had 2 tab. I create this window using QT4.2.2 designet. Now I want add a lebel in tab 0 using code!!!. How can I do it?

  2. #2
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Thanks
    37
    Thanked 53 Times in 40 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: add a label in a QTabWidget

    Please don't double post. (link)
    The biggest difference between time and space is that you can't reuse time.
    -- Merrick Furst

  3. #3
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: add a label in a QTabWidget

    Well, the easiest way I think is just to add the label. Worry about layouts later:
    Qt Code:
    1. QLabel *label = new QLabel("label");
    2. tabWidget->insertTab( -1, label, "Tab Text");
    To copy to clipboard, switch view to plain text mode 

    That's about it.

    Regards

Similar Threads

  1. Replies: 15
    Last Post: 31st January 2020, 18:25
  2. Adding QGroupBox to QTabWidget
    By mclark in forum Newbie
    Replies: 2
    Last Post: 17th January 2007, 16:27
  3. QTabWidget Placement and Display
    By mclark in forum Newbie
    Replies: 1
    Last Post: 16th January 2007, 20:34
  4. Replies: 1
    Last Post: 24th October 2006, 16:40
  5. Corner widget in QTabWidget doesn't show up
    By ePharaoh in forum Qt Programming
    Replies: 2
    Last Post: 6th April 2006, 17:02

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.