Only set iconText() if actually changed
ClosedPublic

Authored by cfeck on Mar 15 2018, 2:35 AM.

Details

Summary

QAction::setIconText() breaks the feature that QAction::iconText() is returning text() when the iconText is empty.

BUG: 391002

Diff Detail

Repository
R236 KWidgetsAddons
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
cfeck created this revision.Mar 15 2018, 2:35 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 15 2018, 2:35 AM
cfeck requested review of this revision.Mar 15 2018, 2:35 AM
chehrlic accepted this revision.Mar 15 2018, 6:02 AM

This should at least fix the most cases as described in the bug report :)

This revision is now accepted and ready to land.Mar 15 2018, 6:02 AM
apol added a subscriber: apol.Mar 15 2018, 11:39 AM
apol added inline comments.
src/kacceleratormanager.cpp
792

What happens when iconText.isEmpty()?

cfeck added inline comments.Mar 15 2018, 1:27 PM
src/kacceleratormanager.cpp
792

Qt returns QAction::text() when QAction::iconText() is empty. Apparently Qt also strips some text, so to check if there was no iconText(), we need this weird check instead of using isEmpty().

This revision was automatically updated to reflect the committed changes.