helloSystem / QtPlugin

Qt platform plugin and style, required for Qt applications to export their menus over D-Bus in the required format
5 stars 4 forks source link

Do not show icons in menus except if specifically requested #14

Closed probonopd closed 2 years ago

probonopd commented 2 years ago

In QtPlugin:

    QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, false);
    QCoreApplication::setAttribute(Qt::AA_DontShowIconsInMenus, true); // probono: need to use myAction->setIconVisibleInMenu(true); for menu items that shall get the icon nevertheless

In Menu:

                        action->setIcon(QIcon(IconCand));
                        action->setIconVisibleInMenu(true); // So that an icon is shown even though the theme sets Qt::AA_DontShowIconsInMenus