Originally Posted by
aamer4yu
You can get the menu for action by
QAction::menu()
Then I guess you can do it ?
You mean like this:
show_XZ_action->setCheckable(true);
....
gl_menu->addAction(show_XZ_action);
....
QPalette palette
= show_XZ_action
->menu
()->palette
();
....
QAction *show_XZ_action = new QAction("Show XZ plane", this);
show_XZ_action->setCheckable(true);
....
gl_menu->addAction(show_XZ_action);
....
QColor XZCol(150, 0, 150);
QPalette palette = show_XZ_action->menu()->palette();
palette.setBrush(QPalette::WindowText, QBrush(XZCol));
....
To copy to clipboard, switch view to plain text mode
It has runtime errors in line "QPalette palette = show_XZ_action->menu()->palette();"
Bookmarks