Results 1 to 5 of 5

Thread: Creating multilevel tabs using qtcreator: How to do that?

  1. #1
    Join Date
    Mar 2015
    Posts
    105
    Thanks
    50

    Default Creating multilevel tabs using qtcreator: How to do that?

    Hello!

    I would like to know how can i create, using qtcreator, Tabs with more than one level in a QDialog. I have a QMainWindow and i put a button which, when clicked, opens a QDialog, another window, thats what i want. Inside this new window i want to put tabs with three levels, like the following picture(Attached), i made this in Java. I know, i have to use QTabWidget, but everytime i go(Insert Page->After Current Page) i create a new tab int the right, but i want a new one in bellow or above.

    How can i do that?
    Attached Images Attached Images

  2. #2
    Join Date
    Mar 2015
    Posts
    105
    Thanks
    50

    Default Re: Creating multilevel tabs using qtcreator: How to do that?

    Guys, is there any other place where i can ask that? Maybe some other forum.

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Creating multilevel tabs using qtcreator: How to do that?

    The QTabWidget and QTabBar do not allow for that behaviour out-of-the box. When there are more tabs than will fit left-to-right you get scrolling controls on the end of the tab bar.

  4. The following user says thank you to ChrisW67 for this useful post:

    robgeek (29th March 2015)

  5. #4
    Join Date
    Mar 2015
    Posts
    105
    Thanks
    50

    Default Re: Creating multilevel tabs using qtcreator: How to do that?

    Ok, thank you very much for your answer!

  6. #5
    Join Date
    Oct 2014
    Posts
    81
    Thanks
    20
    Thanked 9 Times in 9 Posts
    Qt products
    Qt5
    Platforms
    Windows
    Wiki edits
    7

    Default Re: Creating multilevel tabs using qtcreator: How to do that?

    It should be possible to create a custom widget (also known as a "composite widget") that serves as a container and manager for several QTabBar widgets.

    QTabBar is the lowest-level tab widget in Qt. It just serves to draw tabs and provide a simple interaction. I would look into making a custom widget that manages QTabBar children widgets and changes the level depending on the signals.
    I would look in the source of QTabWidget to understand more how a QTabBar manager is like:
    - https://qt.gitorious.org/qt/qtbase/s...s/qtabwidget.h
    - https://qt.gitorious.org/qt/qtbase/s...qtabwidget.cpp

    It doesn't have to be as complex as that since you won't implement a lot of generic features, but rather only what your application needs.
    It should require an advanced understanding of how to subclass widgets to add custom functionality.
    There's a basic example in ZetCode for a custom widget, but it's for Qt4 so it should be just a reference:
    http://zetcode.com/gui/qt4/customwidget/

Similar Threads

  1. Creating sis files for C project Using QtCreator
    By mathi in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 3rd April 2012, 11:51
  2. Replies: 1
    Last Post: 10th May 2011, 18:58
  3. Replies: 0
    Last Post: 31st July 2010, 12:54
  4. Creating Library using QTCreator (hiddevice)
    By AlphaWolfXV in forum Qt Programming
    Replies: 0
    Last Post: 2nd February 2010, 13:02
  5. Creating empty TabWidget (without any tabs)
    By momesana in forum Qt Tools
    Replies: 2
    Last Post: 2nd December 2007, 10:22

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.