PDA

View Full Version : Using Custom QTabBar with QTabWidget.



tvj4218
25th April 2017, 08:06
I have got an app with a QTabWidget. It has a few tabs across the top.
I would like to change the mouse pointer to a different type for each tab.
I've subclassed QTabBar and reimplemented mouseMoveEvent.
I need to set this custom tab bar to QTabWidget using setTabBar.
But this method takes a QTabBar as its argument, and the setTabBar method
is protected.

How do I get around this?

Thanks.

t

Santosh Reddy
25th April 2017, 12:36
I've subclassed QTabBar and reimplemented mouseMoveEvent.
..... setTabBar method
is protected.

How do I get around this?...

Subclass QTabWidget too :)

philw
11th May 2017, 21:57
Subclass QTabWidget too :)

... the point being, that gives you access to the QTabWidget::setTabBar (QTabBar*) protected method. Your QTabWidget subclass doesn't have to have much.