Qt development Session 2

Ahmed Toulan thelinuxer at ubuntu.com
Sun Aug 21 12:46:36 UTC 2011


"connect" is a C++ function, and like any other function you get to choose
when it gets called. But there are some good places in some situations. For
instance the example we gave in our sessions. The widget that has a button.
You would put the "connect" function in the constructor of the Widget class.

Most probably you already did this and it didn't work. That would be because
you called the connect function in a wrong way.
It should be like this in the example I gave above

QObject::connect(pushButton, SLIGNAL(clicked()), this, SLOT(some_func()))

Take care that the signal and slot should have the same number of
parameters, and the "()" of the function should be written even if the
function has no parameters.

Regards,
Ahmed Toulan.

On Sun, Aug 21, 2011 at 2:37 PM, Islam Hassan <iah.vector at gmail.com> wrote:

> Can't, the light went out just before saving (Sayevt ya Ali?  Ali ma
> sayevsh). I'll rewrite it some time later. I just need to know where am I
> supposed to put the connections, int the header file or the cpp file and
> should they be put in a specific section like the slots and the signals ??
>
> --
> Ubuntu-eg mailing list
> Ubuntu-eg at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-eg
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-eg/attachments/20110821/e47bfb3d/attachment.html>


More information about the Ubuntu-eg mailing list