How to hide tabbar in tabwidget if only have one tab?
Printable View
How to hide tabbar in tabwidget if only have one tab?
Did you try tabBar()->hide()?
Im trying to use
ui->tabWidget->tabBar()->hide();
and gives that error:
error: C2248: 'QTabWidget::tabBar' : cannot access protected member declared in class 'QTabWidget'
What is the wrong thing here?
tabBar() is a protected method, you cannot call it from outside QTabWidget class.
So is there any way to change visibility of tab bar completely?
Sure there is. Subclass QTabWidget and provide a public method that will call tabBar()->hide().