I have created a nice looking toolbar using qt Designer and populated it with some actions.
I tried to connect the actions to slots visually from qt designer by clicking edit> signals and slots. This DID NOT WORK because i could not find any QAction signals.
Question.
Is there a way to connect the QAction SIGNAL(triggered()) to my slots within QT designer?
Please help.
PS:
I am currently being forced to connect through code:
QObject::connect(myAction, SIGNAL(triggered()),this, SLOT(myActionWasTriggered()))
but ia am lazy and i wish to connect using qt designer.
There's "Signal/Slot Editor" docked panel (Toggled with View->Signal/Slot Editor). You can connect your actions there. You may also need to add your custom slots via the "Change signals/slots" form context menu.
To save yourself some work, use the auto-connection feature (see QMetaObject::connectSlotsByName). Basically, all slots named with a specific pattern of on_objectName_signalName
will be auto-connected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With