Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.3.0 Beta1
-
None
-
All
-
844044f37b84b1700d356e2fe27b5c6a445f88ea
Description
If I set an 8x8 pixel icon on a tab in a QTabWidget via QTabWidget::setTabIcon(), it is drawn top left. There doesn't seem to be a way to change this, and I traced the code right through to
QCommonStyle::drawControl and then QCommonStylePrivate::tabLayout where it has the code:
*iconRect = QRect(tr.left(), tr.center().y() - tabIconSize.height() / 2,
tabIconSize.width(), tabIconSize .height());
Which I believe is trying to draw the icon centered within tr. So I am raising a ticket as I believe that the intention was that it is center aligned but for some reason that is not what's happening.
This is easily re-creatable using just designer. Create a form, drop on a QTabWidget, put an 8x8 icon on a tab and you'll see it doesn't line up. This seems like it should be configurable from somewhere.
Attachments
For Gerrit Dashboard: QTBUG-38108 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
248690,2 | QTabWidget: properly horizontally align tab icon | dev | qt/qtbase | Status: MERGED | +2 | 0 |