Skip to content

Commit 27cbfaf

Browse files
committed
shortcut config. dialog: display correctly keysequence on macOS
1 parent 856dd08 commit 27cbfaf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/gui/qgsconfigureshortcutsdialog.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ void QgsConfigureShortcutsDialog::populateActions()
6969
{
7070
actionText = action->text();
7171
actionText.remove( '&' ); // remove the accelerator
72-
sequence = action->shortcut().toString();
72+
sequence = action->shortcut().toString( QKeySequence::NativeText );
7373
icon = action->icon();
7474
}
7575
else if ( QShortcut *shortcut = qobject_cast< QShortcut * >( obj ) )
7676
{
7777
actionText = shortcut->whatsThis();
78-
sequence = shortcut->key().toString();
78+
sequence = shortcut->key().toString( QKeySequence::NativeText );
7979
icon = shortcut->property( "Icon" ).value<QIcon>();
8080
}
8181
else
@@ -391,7 +391,7 @@ void QgsConfigureShortcutsDialog::updateShortcutText()
391391
{
392392
// update text of the button so that user can see what has typed already
393393
QKeySequence s( mModifiers + mKey );
394-
btnChangeShortcut->setText( tr( "Input: " ) + s.toString() );
394+
btnChangeShortcut->setText( tr( "Input: " ) + s.toString( QKeySequence::NativeText ) );
395395
}
396396

397397
void QgsConfigureShortcutsDialog::setGettingShortcut( bool getting )
@@ -449,10 +449,10 @@ void QgsConfigureShortcutsDialog::setCurrentActionShortcut( const QKeySequence &
449449
}
450450

451451
// update manager
452-
mManager->setObjectKeySequence( object, s.toString() );
452+
mManager->setObjectKeySequence( object, s.toString( QKeySequence::NativeText ) );
453453

454454
// update gui
455-
treeActions->currentItem()->setText( 1, s.toString() );
455+
treeActions->currentItem()->setText( 1, s.toString( QKeySequence::NativeText ) );
456456

457457
actionChanged( treeActions->currentItem(), nullptr );
458458
}

0 commit comments

Comments
 (0)