Fix shortcuts when using setDefaultAction

Don't remove ampersands when setting the text: they will be removed when
the text is displayed. This fixes double removal of ampersands.

[ChangeLog][QtWidgets][QToolButton] Fix double removal of ampersands

Task-number: QTBUG-23396
Change-Id: I56bf50eb24aae32a81d614824aca0b63363587c8
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
bb10
Paul Olav Tvete 2014-11-10 12:04:56 +01:00 committed by Giuseppe D'Angelo
parent 2e5cfa1ad4
commit 4db5d3ccd1
1 changed files with 1 additions and 1 deletions

View File

@ -897,7 +897,7 @@ void QToolButton::setDefaultAction(QAction *action)
return;
if (!actions().contains(action))
addAction(action);
setText(action->iconText());
setText(action->text());
setIcon(action->icon());
#ifndef QT_NO_TOOLTIP
setToolTip(action->toolTip());