Skip to content

Commit

Permalink
Found a method of setting multiple shortcuts for menu items in Linux …
Browse files Browse the repository at this point in the history
…that works - at least on Linux (doing so in designer did not). Now pushing through to see if it works on macOS - this post (https://stackoverflow.com/questions/23762662/qactionsetshortcuts-only-responds-to-the-first-shortcut-in-the-list) suggests that it might not. Will then test on windows
  • Loading branch information
RussellGarwood committed Apr 26, 2020
1 parent 7fbcf5f commit 6002b24
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions SPIERSedit/src/mainwindowimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,13 @@ MainWindowImpl::MainWindowImpl(QWidget *parent, Qt::WindowFlags f)

//return;
//connect all the menu commands

QList<QKeySequence> shortcuts;
shortcuts.append(QKeySequence(Qt::Key_F1));
shortcuts.append(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_1));
actionMain_Toolbox->setShortcuts(shortcuts);
QObject::connect(actionMain_Toolbox, SIGNAL(triggered()), this, SLOT(Menu_Window_MainToolbox()));

QObject::connect(actionGeneration, SIGNAL(triggered()), this, SLOT(Menu_Window_Generate()));
QObject::connect(actionSlice_Selector, SIGNAL(triggered()), this, SLOT(Menu_Window_SliceSelector()));
QObject::connect(actionMasks, SIGNAL(triggered()), this, SLOT(Menu_Window_Masks()));
Expand Down
2 changes: 1 addition & 1 deletion SPIERSedit/ui/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
<x>0</x>
<y>0</y>
<width>962</width>
<height>20</height>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
Expand Down

1 comment on commit 6002b24

@RussellGarwood
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works on macOS

Please sign in to comment.