QTabWidget - tab position.
-
Hi,
I am working with QtabWidget.
I need to implement some thing like : There should be two tabs, one tab should always be at the left most and another tab should always be at the right most of QtabWidget and rest of the tabs which will be added dynamically should be added between these two tabs.I am not sure whether the above is possible or not. If possible then how ?
If anyone is having any idea?
Maahi
-
Hii,
Qt also provides QTabBar
see here
http://qt-project.org/doc/qt-5/QTabBar.html#details -
Thanks for your response.
But I need the tab should always be at the right most of the tabwidget or tabbar.
If there are only two tabs , then one should be at the right most and another should b left most and there should be gap between them and if the third tab is added then it should be added between the two tabs.Maahi
-
I guess for that purpose you can create a list of QPushButton using QList<QPushButton*>
From Docs:
In QList<T> Items can be added at either end of the list using QList::append() and QList::prepend(), or they can be inserted in the middle using QList::insert(). More than any other container class, QList is highly optimized to expand to as little code as possible in the executable. QStringList inherits from QList<QString>.
hope it helps.