PDA

View Full Version : find out which shortcut triggered action



qt_gotcha
22nd August 2010, 10:33
I can't find how to see which shortcut triggered an action. I have a find/replace window and want certain widgets to be disabled when the user presses the replace keysequence and others when the find sequence is pressed
thanks

yakin
22nd August 2010, 16:00
You can construct two objects of type QShortcut and connect the activated method to a slot, where you enable / disable your widgets.
Greetz Yakin

aamer4yu
23rd August 2010, 00:05
I can't find how to see which shortcut triggered an action
But you can always know which action was triggered using QObject::sender() :rolleyes:

qt_gotcha
23rd August 2010, 20:27
ok, thanks, makes sense.