How to I remove close button from individual tab ?
Found that but it works only for QTabBar I need that for QTabWidget which seems to not have this option there.
http://www.qtcentre.org/threads/1945...Widget-QTabBar
How to I remove close button from individual tab ?
Found that but it works only for QTabBar I need that for QTabWidget which seems to not have this option there.
http://www.qtcentre.org/threads/1945...Widget-QTabBar
QTabWidget::setTabsClosable()
Subclass QTabWidget, use QTabBar::tabButton() to access the button from the tab you want to modify and call hide() on it. Alternatively you can hack into the tabbar from an existing tab widget, like so:
Qt Code:
class HackedTabWidget { friend class SomeClass; }; void SomeClass::someMethod() { // ... HackedTabWidget *htw = (HackedTabWidget*)tw; }To copy to clipboard, switch view to plain text mode
If you don't feel comfortable with hacking into the tabbar, use inheritance instead.
migel (20th September 2011)
Bookmarks