#4903 Use helper function for action shortcut everywhere

This commit is contained in:
Magne Sjaastad
2019-10-25 12:48:17 +02:00
parent f2d5adca60
commit 29c3ce0d06
8 changed files with 20 additions and 13 deletions

View File

@@ -328,27 +328,27 @@ void RiuMainWindow::createActions()
// View actions
m_viewFromNorth = new QAction( QIcon( ":/SouthViewArrow.png" ), "Look South", this );
m_viewFromNorth->setToolTip( "Look South (Ctrl+Alt+S)" );
m_viewFromNorth->setShortcut( QKeySequence( tr( "Ctrl+Alt+S" ) ) );
caf::CmdFeature::applyShortcutWithHintToAction( m_viewFromNorth, QKeySequence( tr( "Ctrl+Alt+S" ) ) );
m_viewFromSouth = new QAction( QIcon( ":/NorthViewArrow.png" ), "Look North", this );
m_viewFromSouth->setToolTip( "Look North (Ctrl+Alt+N)" );
m_viewFromSouth->setShortcut( QKeySequence( tr( "Ctrl+Alt+N" ) ) );
caf::CmdFeature::applyShortcutWithHintToAction( m_viewFromSouth, QKeySequence( tr( "Ctrl+Alt+N" ) ) );
m_viewFromEast = new QAction( QIcon( ":/WestViewArrow.png" ), "Look West", this );
m_viewFromEast->setToolTip( "Look West (Ctrl+Alt+W)" );
m_viewFromEast->setShortcut( QKeySequence( tr( "Ctrl+Alt+W" ) ) );
caf::CmdFeature::applyShortcutWithHintToAction( m_viewFromEast, QKeySequence( tr( "Ctrl+Alt+W" ) ) );
m_viewFromWest = new QAction( QIcon( ":/EastViewArrow.png" ), "Look East", this );
m_viewFromWest->setToolTip( "Look East (Ctrl+Alt+E)" );
m_viewFromWest->setShortcut( QKeySequence( tr( "Ctrl+Alt+E" ) ) );
caf::CmdFeature::applyShortcutWithHintToAction( m_viewFromWest, QKeySequence( tr( "Ctrl+Alt+E" ) ) );
m_viewFromAbove = new QAction( QIcon( ":/DownViewArrow.png" ), "Look Down", this );
m_viewFromAbove->setToolTip( "Look Down (Ctrl+Alt+D)" );
m_viewFromAbove->setShortcut( QKeySequence( tr( "Ctrl+Alt+D" ) ) );
caf::CmdFeature::applyShortcutWithHintToAction( m_viewFromAbove, QKeySequence( tr( "Ctrl+Alt+D" ) ) );
m_viewFromBelow = new QAction( QIcon( ":/UpViewArrow.png" ), "Look Up", this );
m_viewFromBelow->setToolTip( "Look Up (Ctrl+Alt+U)" );
m_viewFromBelow->setShortcut( QKeySequence( tr( "Ctrl+Alt+U" ) ) );
caf::CmdFeature::applyShortcutWithHintToAction( m_viewFromBelow, QKeySequence( tr( "Ctrl+Alt+U" ) ) );
connect( m_viewFromNorth, SIGNAL( triggered() ), SLOT( slotViewFromNorth() ) );
connect( m_viewFromSouth, SIGNAL( triggered() ), SLOT( slotViewFromSouth() ) );