Interesting, the documentation claims that the return value of tabBar() is QTabBar*, without any const: http://doc.qt.io/qt-5/qtabwidget.html#tabBar

Cheers,
_