Hello all,
Yesterday I struggled to change the mouse cursor on hover over a tabbar on a QTabWidget.
If we use the setCursor() function on the QTabWidgetobject, the cursor will change regardless of which sub-widget the mouse is over. So for both the pane and the tab the cursor would be the same (in my case, a pointing hand).
I thought I could get the tabbar object from QTabWidget and set it's cursor but, unfortunately, as we all know, QTabWidget->tabbar() and setTabBar() are protected methods (and there might be good reasons for that).
After a few more bashing, I tried to go through the children of the QTabWidget, found the tabbar and set it's cursor. Here's how I did it:
Qt Code:
  1. QList<QTabBar *> tabBar = this->ui->tabWidget->findChildren<QTabBar *>();
  2. tabBar.at(0)->setCursor(Qt::PointingHandCursor);
To copy to clipboard, switch view to plain text mode 

Hope it helps