Reputation:
My goal is to declare & implement a signal which will be triggered each time I press an action from menu. The Qt docs does not help me much in this direction.
Basically I must declare this signal in plugin interface, then emit this signal in plugin implementation file. This supposes to declare a slot, where I should to emit this signal. But it will be not called each time I press action.
The question is how to make a custom signal to work as standard signal QAction::triggered
?
Upvotes: 3
Views: 535
Reputation: 27593
You can connect signals to other signals in Qt. This emits the second signal whenever the first one is emitted.
connect(menuAction, SIGNAL(triggered()), this, SIGNAL(connectedSignal()));
Upvotes: 4