Use signals and slots to connect the action's triggered() signal to a slot you want executed.