Hmm, if you are using the actions context menu policy I'm not really sure what's the problem.
As the action is created somewhere in the constructor or so, that it exists during the lifetime of the widget, the action should be triggered as well.
Maybe the shortcut event goes to a wrong widget or something.
Anyway, how about this way, does it work?
connect(copyShortcut, SIGNAL(activated()), copyAct, SLOT(trigger()));
QShortcut* copyShortcut = new QShortcut(QKeySequence("Ctrl+C"), this);
connect(copyShortcut, SIGNAL(activated()), copyAct, SLOT(trigger()));
To copy to clipboard, switch view to plain text mode
Bookmarks