I am using QTabWidget in my project. Is there any good reason I should use QTabBar and not QTabWidget?
What advantages I have if I use QTabWidget?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
QTabWidget associates a QWidget to each tab of a QTabBar. So widget management when switching from one tab to an other is already done by the QTabWidget class. It was done for convenience. See documentation for more details : http://doc.qt.io/qt-4.8/qtabwidget.html#details.
QTabBar is only a tab bar. You can do every thing you want when switching from one tab to an other. More details.
The best advantage is that QTabWidget combines QTabBar AND QStackedWidget behaviors.