Results 1 to 3 of 3

Thread: Creating empty TabWidget (without any tabs)

  1. #1
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    258
    Thanks
    22
    Thanked 19 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Creating empty TabWidget (without any tabs)

    How can I create a QTabWidget (which is promoted to a custom widget) that has no tabs at all so I can add them in code later? I have a custom Widget TabWidget that is derived from QTabWidget and I have promoted the QTabWidget in question to such a TabWidget. In the TabWidget constructor I add a single tab. Right now this results in three tabs in the end because designer adds two tabs of its own, that I want to get rid of. I can delete one of them in designer but at least one tab is always present and can not be deleted. Of course I could delete the tab in code but I don't like to have such an ugly workaround.

    Thanx in advance

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Creating empty TabWidget (without any tabs)

    I guess promoting TabWidget in Designer as plain QWidget as its base class would do the trick. Of course, it won't look like a tab widget in Designer but no default tabs get added either.
    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Creating empty TabWidget (without any tabs)

    I think it is possible to hack the ui file and delete the part of the xml code responsible for those tabs. I don't know how will Designer behave if you try to load such file into it, though.

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.