1 Attachment(s)
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?
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.
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.
Re: Creating multilevel tabs using qtcreator: How to do that?
Ok, thank you very much for your answer!
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/