-
Bug
-
Resolution: Cannot Reproduce
-
P4: Low
-
None
-
5.6.1
-
None
Applied the following StyleSheet to the QMenu:
"QMenu {" "border:0px;" "background-color: transparent;" "icon-size: 36px;" "}" "QMenu::item {" "border:1px solid #8f8f91;" "background-color: black;" "color:#FFFFFF;" // text color "padding:10px;" "padding-left:36px;" "icon-size: 36px;" "}" "QMenu::item::disabled {" "background-color:#505050;" "color:#C0C0C0;" // text color "icon-size: 36px;" "}" "QMenu::item::selected {" "background-color:rgb(255,152,4);" "color:#FFFFFF;" // text color "icon-size: 36px" "}" "QMenu::item::pressed {" "background-color:rgb(255,152,4);" "color:#FFFFFF;" "icon-size: 36px;" "}" "QMenu::icon {" "icon-size: 36px;" "}" "QMenu::indicator {" "width: 36px;" "height: 36px;" "icon-size: 36px;" "}" "QMenu::indicator:non-exclusive:checked {" "image: url(://res/checkbox_checked.png);" "}" "QMenu::indicator:non-exclusive:unchecked {" "image: url(://res/checkbox_unchecked.png);" "}" "QMenu::indicator:exclusive:checked {" "image: url(://res/radio_checked.png);" "}" "QMenu::indicator:exclusive:unchecked {" "image: url(://res/radio_unchecked.png);" "}" "QMenu::separator {" "height:2px;" "background: white;" "margin-left: 0px;" "margin-right: 0px;" "}"
The result is attached.
Note that icon (2 bottom items) is drawn incorrectly - its size is default - 20px although the space (for icon) is properly reserved
The reason is that at qstylesheetstyle.cpp line 3589
pixmap = mi.icon.pixmap(pixelMetric(PM_SmallIconSize), mode, QIcon::On);
- pixelMetric(PM_SmallIconSize) returns 20
although call to pixelMetric(PM_SmallIconSize) from qmenu.cpp line 281
icone = style->pixelMetric(QStyle::PM_SmallIconSize, &opt, q); - returns correctly 36 (from the StyleSheet).