PDA

View Full Version : My Slot Function



qtoptus
3rd November 2010, 16:18
Hello,

I add signal/slot through the designer and specify the custom slot function for the main form window. However when I look for that function's definition in Visual Studio I cannot find it, and hence I cannot edit it. How can I add code to the body of this slot function?

Thanks.

wysota
3rd November 2010, 16:24
Designer doesn't modify your source code, it only declares that the signal or slot will exist in the widget the form is deployed on. But you have to create the actual slot (or signal) yourself in the subclass of QWidget (notice the form class doesn't inherit QWidget).

qtoptus
3rd November 2010, 16:39
This means I need to add "slot: myfunction(..)" declaration and definition to the QWidget class, not to the class where the connect(...) statement was added by the designer?

wysota
3rd November 2010, 17:38
Yes, something like that.