[Qt-creator] no slots created for actions in creator

Friedemann Kleint Friedemann.Kleint at nokia.com
Mon May 25 08:58:29 CEST 2009


 Hi
>
> I'm taking elearning course of Qt Designer on elearning.ics.com
> They say "actions are automatically connected to slots" but I created a
> few actions in Qt Creator and don't see any slots being generated for them.
> Any ideas?


In the action editor tab of Qt Creator's form editor, open the context menu 
(right click) of the action and choose "Go to slot". This will either generate 
the slot code or show an existing implementation.
Note that this uses the "Connect slots by name" 
 ( http://doc.qtsoftware.com/4.5/qmetaobject.html#connectSlotsByName ) 
functionality, which is bound to silently break if you rename the action later 
on. To avoid this, you can manually do the connection in the form constructor, 
for which Qt Creator provides a convenient code completion.

For the form container or promoted widgets, it is also possible to "declare"
signals and slots within Qt Designer via context menu of the respective 
widget. They then appear in the Qt Designer's Signal-Slot Editor and can be 
connected to within Qt Designer.

To do signal-slot connections to actions within Qt Designer, you can use the 
Signal-Slot Editor tab/window. Choose '+' for a new connection and select the 
action from the list of senders.

I hope this helps,

Regards,
Friedemann

-- 
Friedemann Kleint
Nokia, Qt Software

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20090525/e123403b/attachment.html 


More information about the Qt-creator-old mailing list