Qt-interest Archive, April 2007
Cannot queue arguments of type 'QVariant'
Message 1 in thread
I have a signal with the signature (QString&, QString&, QVariant&) that works well in most of my app
but now a function that runs in a separate thread emits this signal but that suddenly gives me the warning
message "Cannot queue arguments of type 'QVariant' ".
Anyone out there who has a pointer towards a solution please?
_____________________________________________________________________________________
Ulf Rosvall
Subvision AB
Fjellie Skola
237 91 Bjärred
Sweden
Tel: +46(0)46 13 20 45
Message 2 in thread
> I have a signal with the signature (QString&, QString&, QVariant&) that
> works well in most of my app
> but now a function that runs in a separate thread emits this signal but that
> suddenly gives me the warning
> message "Cannot queue arguments of type 'QVariant' ".
>
> Anyone out there who has a pointer towards a solution please?
Make them const references and use
qRegisterMetaType<QVariant>("QVariant");
anywhere before emitting the signal if still needed.
--
[ signature omitted ]
Message 3 in thread
Thanks!
That did the trick, I had missread the documentation earlier and written
qRegisterMetaType("QVariant"), without the type cluse
and the compiler silently swallowed that but the error persisted.
/Ulf
----- Original Message -----
From: "J-P Nurmi" <jpnurmi@xxxxxxxxx>
To: "Qt-interest" <qt-interest@xxxxxxxxxxxxx>
Sent: Friday, April 27, 2007 1:07 PM
Subject: Re: Cannot queue arguments of type 'QVariant'
>> I have a signal with the signature (QString&, QString&, QVariant&) that
>> works well in most of my app
>> but now a function that runs in a separate thread emits this signal but
>> that
>> suddenly gives me the warning
>> message "Cannot queue arguments of type 'QVariant' ".
>>
>> Anyone out there who has a pointer towards a solution please?
> Make them const references and use
> qRegisterMetaType<QVariant>("QVariant");
> anywhere before emitting the signal if still needed.
>
> --
> J-P Nurmi
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
--
[ signature omitted ]
Message 4 in thread
Still leaves the question (directed to Trolltech) why QVariant needs to be
registerd to be used in signals/slots while QVariantList (e.g.) is already
registered and useable. Isn't QVariant _designed_ to be an all-purpose
container and thus designated to be used in signals/slots and should be
instantly useable everywhere without such little mantraps ?
Or is there a special reason that it is not pre-registered?
Mit freundlichen Grüßen
Dipl.-Inf. Univ. Simon Frischeisen
_____
Mane und Frischeisen GmbH - Amtsgericht München HRB 150833
Steuernummer 143/159/30317 - USt-IDNr. DE232665168
Geschäftsführer: Dipl.-Phys. Univ. Ingo Mane, Dipl.-Inf. Univ. Simon
Frischeisen
Pütrichstr. 8 - 81667 München
Telefon: +49-89-44449505 - Fax.: +49-89-44449506
Internet: http://www.mane-frischeisen.de
--
[ signature omitted ]