Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-44565

CLONE - QAction::setIconVisibleInMenu does not work.

    XMLWordPrintable

Details

    Description

      The Qt documentation states that setIconVisibleInMenu has priority over Qt::AA_DontShowIconsInMenus.
      Good. But unfortunatly it does not work in this case:

      if Qt::AA_DontShowIconsInMenus is set to TRUE
      then setIconVisibleInMenu(true) has no effect

      The bug is easy to identify in qaction.cpp in function:
      void QAction::setIconVisibleInMenu(bool visible)

      There is the line:

      if (visible != (bool)d->iconVisibleInMenu)

      But this if FALSE if d->iconVisibleInMenu is -1 and visible is true.
      The line should rather be:

      if ((int)visible != d->iconVisibleInMenu)

      Another related issue in the same function is the line:

      && visible == !QApplication::instance()->testAttribute(Qt::AA_DontShowIconsInMenus))) {

      should be changed for:

      && visible != !QApplication::instance()->testAttribute(Qt::AA_DontShowIconsInMenus))) {

      making these changes seems to restore expected functionality.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            mrb_scribus MrB
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes