I am trying to change the icon of a QMenu's right arrow. The following QSS rule works
QMenu::right-arrow {
image: url(icons:icon_name.svg);
}
However, it changes the right arrows of all QMenus. I want to select only QMenus that have some property/name. I tried the following things:
/* shouldHide is a boolean property set to true */
QMenu[shouldHide="true"]::right-arrow {
image: url(icons:icon_name.svg);
}
QMenu::right-arrow[shouldHide="true"] {
image: url(icons:icon_name.svg);
}
I also tried wrapping the QMenu in a hidden QWidget and setting the stylesheet on the parent
container->setStyleSheet("QMenu::right-arrow: {image: url(icons:icon_name.svg); }");
I also attempted to set the style sheet on the menu itself in the following ways:
menu->setStyleSheet("QMenu::right-arrow: {image: url(icons:icon_name.svg); }");
menu->setStyleSheet("*::right-arrow: {image: url(icons:icon_name.svg); }");
... and none of them work.