tdf#120824 KDE5: fix visible/enabled state for menu

Change-Id: I003703f0bc2e1697124e068a68bfb2e24c33cd1a
Reviewed-on: https://gerrit.libreoffice.org/68351
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
(cherry picked from commit ea6b4b743d397f40029291954af6d37d9059042b)
Reviewed-on: https://gerrit.libreoffice.org/68412
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx
index 8fee56a..049d90b 100644
--- a/vcl/qt5/Qt5Menu.cxx
+++ b/vcl/qt5/Qt5Menu.cxx
@@ -157,15 +157,19 @@ QMenu* Qt5Menu::InsertMenuItem(Qt5MenuItem* pSalMenuItem, unsigned nPos)
                    pAction->setChecked(bChecked);
                }

                pAction->setEnabled(pSalMenuItem->mbEnabled);
                pAction->setVisible(pSalMenuItem->mbVisible);

                connect(pAction, &QAction::triggered, this,
                        [pSalMenuItem] { slotMenuTriggered(pSalMenuItem); });
            }
        }
    }

    QAction* pAction = pSalMenuItem->getAction();
    if (pAction)
    {
        pAction->setEnabled(pSalMenuItem->mbEnabled);
        pAction->setVisible(pSalMenuItem->mbVisible);
    }

    return pQMenu;
}