[Qt-interest] need help with qobject connect
Felipe Romero Gonzalez
fjromerog at gmail.com
Wed Aug 5 17:49:58 CEST 2009
Hi Ivan:
Maybe the reason is that you are trying to run 2 process modifying a
variable at the same time. Why you dont try to use QueuedConnection.
Regards
Felipe
2009/8/5 Ivan Lyapunov <qt4box at gmail.com>
> hello
>
> here is a piece of code with trouble
>
> struct aStruct {
> int a;
> double b;
> bool c;
> }
>
> Q_DECLARE_METATYPE(aStruct);
>
> int main {
> qRegisterMetaType<aStruct>("aStruct");
> QObject::connect(obj1, SIGNAL(func1(aStruct&)), obj2,
> SLOT(func2(aStruct&)));
> }
>
> gives me
> QObject::connect: Cannot queue arguments of type 'aStruct&'
> (Make sure 'aStruct&' is registered using qRegisterMetaType().)
>
>
> however qRegisterMetaType<aStruct>("aStruct&");
> QObject::connect works but its looks like a trouble ))
>
> QObject::connect(obj1, SIGNAL(func1(const aStruct&)), obj2,
> SLOT(func2(const aStruct&)));
> works but i don't need a const specifier
>
> i need a help how can i do connect functions with reference
>
> Regards,
> Ivan
>
>
>
>
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090805/1880df31/attachment.html
More information about the Qt-interest-old
mailing list