PDA

View Full Version : menu tearoffs/submenus not using stylesheet



ntp
9th March 2009, 05:31
I have customized my menu using a .qss stylesheet like this:



QMenu
{
background-color: #eaeaea;
color: black;
}
QMenu::item::disabled
{
color: rgb(213,213,213);
}
QMenu::separator {
height: 1px;
background: black;
margin-left: 5px;
margin-right: 5px;
}


This works great for main menus. However one of the menuitems has its own submenu and that is not showing up with any of these properties. I tried doing:


QMenu::tear-off
{
background-color: #eaeaea;
color: black;
}
QMenu::tear-off::item::disabled
{
color: rgb(213,213,213);
}


but that has no effect. Is there a different way to do this?

Thanks!

papius_vtualetius
11th October 2010, 16:50
use QMenu::tearoff, not tear-off

papius_vtualetius
11th October 2010, 16:51
and you can set styleSheet to the whole app (qApp->setStyleSheet) and it will style all menus you create