Unsolved How to change QTabBar close button size
-
I saw the post from 2013, but now at 2021, I hope there is a better solution.
https://forum.qt.io/topic/36002/changing-qtabbar-close-buttonI'm trying change the size of QTabBar close button. The setClosable() make this button appears, but it looks like a 16x16 png icon so even I set the styleSheet to the new width and height doesn't work. Then I change the icon to my own svg icon, it's still not working. Is it correct that width and height setting from stylesheet for this close button just doesn't work? Is there any way to change the size of this close button without subclassing and writing close related functions? I wish there are methods from QTabBar to customize the close button.
Any help/info would be appreaciated.
-
Did you already checked QTabWidget::iconSize ?
-
Tried
QTabWidget::setIconSize
andQTabBar::setIconSize
, close icon size won't change.
Also I tried set a qss:
QTabBar { icon-size: 8px; }
QTabBar { icon-size: 8px 8px; }
Still cannot change icons size;
doc reference:
https://doc.qt.io/qt-6/stylesheet-reference.html
https://doc.qt.io/qt-5/qtabbar.html#iconSize-prop