Results 1 to 12 of 12

Thread: QTabWidget - Add Tabs dynamically

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11
    Thanks
    8
    Thanked 14 Times in 14 Posts

    Default Re: QTabWidget - Add Tabs dynamically

    You can see it in your system folder undo folder.
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

  2. #2
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android
    Thanks
    111
    Thanked 4 Times in 4 Posts

    Default Re: QTabWidget - Add Tabs dynamically

    And just to comment: I've read in the docs that widget. which will be used, must be previously created WITHOUT parent.
    Qt 5.3 Opensource & Creator 3.1.2

  3. #3
    Join Date
    Dec 2007
    Posts
    119
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: QTabWidget - Add Tabs dynamically

    ok I've resolved the problem...it was releated to tab->show() that doesn't work well.
    I use instead twAlarms->showPage(...) and now the layout is fine.

  4. #4
    Join Date
    Dec 2007
    Posts
    119
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: QTabWidget - Add Tabs dynamically

    another problem.... in my QTabWidget I have several tabs that may be of two kinds: tab with inside Alarm1 Widget and tab with inside Alarm2 Widget....Alarm1 and Alarm2 have both a QLabel like an unique identifier of the alarm type.
    Now I want to search in the whole QTabWidget which tab containe the Alarm with a particular "identifier"....any idea how to do this?

  5. #5
    Join Date
    Sep 2006
    Posts
    46
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    2
    Thanked 3 Times in 2 Posts

    Default Re: QTabWidget - Add Tabs dynamically

    Use a QHash with either your QLabel or a QString as a lookup index for your alarm widget. There are many examples of similar lookups in QtDemo.

    Qt Code:
    1. QHash <QLabel *, QWidget *> labelForWidget;
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. QTabWidget with same tabs
    By Djony in forum Qt Programming
    Replies: 20
    Last Post: 24th December 2011, 13:20
  2. Delayed Rendering of QTabWidget Tabs
    By mclark in forum Qt Tools
    Replies: 13
    Last Post: 14th May 2007, 23:53
  3. QTabWidget tab visibility
    By dcss-design in forum Qt Programming
    Replies: 2
    Last Post: 31st January 2007, 00:24
  4. Switching off all tabs in QTabWidget
    By Gopala Krishna in forum Qt Programming
    Replies: 7
    Last Post: 30th August 2006, 18:10
  5. Dynamically adding tabs
    By larry104 in forum Qt Programming
    Replies: 7
    Last Post: 26th July 2006, 21: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.