Is there an easy way to display the tabbar only when there are more than 1 tabs? Right now, I've a subclassed QTabBar and redefined tabInserted, tabRemoved to check the numbers of tabs and toggle the visibility of the Tabbar accordingly. Is there a more simple way to do this? Maybe a member function of QTabWidget where I can activate/deactivate this behaviour? I could'nt find anything.
Qt Code:
#ifndef TABBAR_H #define TABBAR_H #include <QTabBar> { Q_OBJECT public: private: void toggleVisibility() { (count() <= 1) ? hide() : show(); } protected: void tabInserted(int) { toggleVisibility(); } void tabRemoved(int) { toggleVisibility(); } }; #endifTo copy to clipboard, switch view to plain text mode
Bookmarks