While investigating https://bugreports.qt.io/browse/QTBUG-65771 I found out that KF5 is setting QAction::setIconText() for no reason in KPopupAccelManager::setMenuEntries(). This breaks the feature that QAction::iconText() is returning text() when the iconText is empty and therefore the text in the toolbar is not updated as expected when running inside KF% environment (see testcase in Qt bugreport).
Thanks Christian for the investigation. Do I understand it correctly, that moving the setIconText() call into the 'if' (after line 793) is sufficient to fix the issue?
For reference: https://cgit.kde.org/kwidgetsaddons.git/tree/src/kacceleratormanager.cpp#n793
When you set the iconText only when the text is changed it would at least fix the bug report I would guess. The problem is that it's unknown if the iconText is set programatically or not and even watching for QEvent::ActionChanged does not really help... btw: The change was introduced with https://phabricator.kde.org/D7964
https://phabricator.kde.org/D11346
Git commit 7fe64f532d381bb43ecc03fa6d94e59f3c30ba1d by Christoph Feck. Committed on 30/03/2018 at 00:18. Pushed by cfeck into branch 'master'. [KAcceleratorManager] Only set iconText() if actually changed QAction::setIconText() breaks the feature that QAction::iconText() is returning text() when the iconText is empty. Reviewed by Christian Ehrlicher Differential Revision: https://phabricator.kde.org/D11346 M +3 -1 src/kacceleratormanager.cpp https://commits.kde.org/kwidgetsaddons/7fe64f532d381bb43ecc03fa6d94e59f3c30ba1d