@@ -221,20 +221,22 @@ public slots:
221
221
inline QAction* connectAction (QAction* action, const char * slot)
222
222
{
223
223
connect (action, SIGNAL (triggered (bool )), this , slot);
224
- addAction (action);
225
224
return action;
226
225
}
227
226
228
227
inline QAction* connectShortcutAction (QAction* action, const char * shortcut)
229
228
{
230
229
actionShortcutPairs.push_back (ActionShortcut (action, shortcut));
231
230
action->setShortcut (ConfigShortcut (shortcut));
231
+ action->setShortcutContext (Qt::WidgetShortcut);
232
+ addAction (action);
232
233
return action;
233
234
}
234
235
235
236
inline QAction* connectMenuAction (QMenu* menu, QAction* action)
236
237
{
237
- return connectMenuAction (menu, action);
238
+ menu->addAction (action);
239
+ return action;
238
240
}
239
241
240
242
protected:
@@ -268,12 +270,12 @@ public slots:
268
270
return connectMenuAction (menu, makeAction (icon, text, slot));
269
271
}
270
272
271
- inline QAction* makeMenuShortcutAction (QMenu* menu, const QString & text, const char * slot, const char * shortcut)
273
+ inline QAction* makeShortcutMenuAction (QMenu* menu, const QString & text, const char * slot, const char * shortcut)
272
274
{
273
275
return connectShortcutAction (makeMenuAction (menu, text, slot), shortcut);
274
276
}
275
277
276
- inline QAction* makeMenuShortcutAction (QMenu* menu, const QIcon & icon, const QString & text, const char * slot, const char * shortcut)
278
+ inline QAction* makeShortcutMenuAction (QMenu* menu, const QIcon & icon, const QString & text, const char * slot, const char * shortcut)
277
279
{
278
280
return connectShortcutAction (makeMenuAction (menu, icon, text, slot), shortcut);
279
281
}
0 commit comments