Need to show a menu item with disabled look but functional
Hello!
I would like to present to the user of my software a menu, with a few actions disabled. But I want that if the user presses these disabled actions, he gets a message box to say that they must be enabled from the settings.
So, I want an enabled action, but with disabled look. Is that possible?
Re: Need to show a menu item with disabled look but functional
try to use Style Sheets, take a look at here.
Re: Need to show a menu item with disabled look but functional
Quote:
Originally Posted by
spirit
try to use Style Sheets, take a look at
here.
Thank you, I looked there, but it seems that I can only style the whole menu. But I want to style only a few actions from the whole menu which has more actions.
I tried another approach, to use menu->palette and setPalette, but again the QAction has no palette.
Re: Need to show a menu item with disabled look but functional
then disable all necessary actions, install event filter (QObject::installEventFilter) for QMenu and then catch QMouseEvent. an action by mouse click point you can get using QMenu::actionAt
Re: Need to show a menu item with disabled look but functional
OK, thank you! I'll think of your solution.