[Qt-interest] Treating User defined type as QVariant via void*

Santhosh Y santhosh at softjin.com
Wed Sep 22 13:09:01 CEST 2010


On 9/22/2010 4:16 PM, Stephen Kelly wrote:
> You never use the macro Q_DECLARE_METATYPE
>
> Have a read through the docs for QVariant and QMetaType.
>
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>    
1>------ Rebuild All started: Project: variant_test, Configuration: 
Debug Win32 ------
1>Deleting intermediate and output files for project 'variant_test', 
configuration 'Debug|Win32'
1>Compiling...
1>variant.cpp
1>.\variant.cpp(37) : warning C4100: 'n' : unreferenced formal parameter
1>c:\qt\4.5.2\include\qtcore\../../src/corelib/kernel/qmetatype.h(189) : 
error C2039: 'qt_metatype_id' : is not a member of 'QMetaTypeId<T>'
1>        with
1>        [
1>            T=Node *
1>        ]
1>        
c:\qt\4.5.2\include\qtcore\../../src/corelib/kernel/qmetatype.h(189) : 
while compiling class template member function 'int 
QMetaTypeId2<T>::qt_metatype_id(void)'
1>        with
1>        [
1>            T=Node *
1>        ]
1>        
c:\qt\4.5.2\include\qtcore\../../src/corelib/kernel/qmetatype.h(199) : 
see reference to class template instantiation 'QMetaTypeId2<T>' being 
compiled
1>        with
1>        [
1>            T=Node *
1>        ]
1>        
c:\qt\4.5.2\include\qtcore\../../src/corelib/kernel/qvariant.h(585) : 
see reference to function template instantiation 'int qMetaTypeId<T>(T 
*)' being compiled
1>        with
1>        [
1>            T=Node *
1>        ]
1>        
c:\qt\4.5.2\include\qtcore\../../src/corelib/kernel/qvariant.h(327) : 
see reference to function template instantiation 'bool 
qVariantCanConvert<T>(const QVariant &)' being compiled
1>        with
1>        [
1>            T=Node *
1>        ]
1>        .\variant.cpp(71) : see reference to function template 
instantiation 'bool QVariant::canConvert<Node*>(void) const' being compiled
1>Build log was saved at 
"file://c:\cygwin\home\AFTERCHANGE\aera2GUI\variant_test\debug\BuildLog.htm"
1>variant_test - 1 error(s), 1 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========



Please see my attached file with the suggested changes included.

-- 
----------------------------------------------------
Y Santhosh Kumar -
Senior Software Engineer,
SoftJin Technologies Pvt Ltd,
www.softjin.com
----------------------------------------------------



Business Disclaimer
____________________________________________________________
This e-mail message and any files transmitted with it are intended solely
for  the use  of the  individual or entity  to which they  are  addressed. It
may  contain confidential,  proprietary or legally  privileged  information.
If  you  are  not  the  intended recipient please be advised that you have
received  this  message in error and any use is strictly prohibited. Please
immediately  delete it  and all copies of it from your system, destroy any
hard  copies  of  it and  notify  the  sender  by return mail. You must not,
directly or indirectly, use,  disclose,  distribute, print, or copy any part of
this message if you are not the intended recipient.
___________________________________________________________
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: variant.cpp
Url: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100922/36f2d15a/attachment.pl 


More information about the Qt-interest-old mailing list