qt-interest@trolltech.com
[Top] [All Lists]

Re: [Qt-interest] structure through connect()

Subject: Re: [Qt-interest] structure through connect()
From: John McClurkin
Date: Wed, 12 Aug 2009 08:51:16 -0400
Chandru... wrote:
> hi friends,
> is it possible ti send data structure through connect from one object to 
> another ... 
> 
> how ..?
> 
> -- 
> WAGMARE
> 
> 
Well, have you tried something that didn't work? Do you want to use 
direct connections or queued connections? For direct connections, just 
pass the structure by reference or by value as described in the 
documentation, i.e.:

void mySlot(MyStruct struct)
{
}
connect(obj1, SIGNAL(mySig(MyStruct)), obj2, SLOT(mySlot(MyStruct)));

or

void mySlot(MyStruct &struct)
{
}
connect(obj1, SIGNAL(mySig(MyStruct &)), obj2, SLOT(MySlot(MyStruct&)));

I don't think you can send references in queued connections.
_______________________________________________
Qt-interest mailing list
Qt-interest@xxxxxxxxxxxxx
http://lists.trolltech.com/mailman/listinfo/qt-interest

<Prev in Thread] Current Thread [Next in Thread>