[Qt-interest] How to access a slot with pass by reference parameter?

Ning, Hui hning at wms.com
Mon Mar 30 18:44:32 CEST 2009


Hi,

 

I have a public slot with struct Point as a reference parameter, like 

 

Public slots:  void Test( Point& a );

 

I have done 

 

Q_DECLARE_METATYPE(Point)

Q_DECLARE_METATYPE(Point*)

 

qRegisterMetaType<Point>("Point");

qRegisterMetaType<Point*>("Point*");

 

but I can't do

 

Q_DECLARE_METATYPE(Point&)

qRegisterMetaType<Point&<("Point&");

 

as I am having compiling error. 

 

If I try to call Test(Point & a ) in a script file, I will get such
error as 

 

TypeError: cannot call Test(): unknown type 'Point&'. 

 

Please help. I need to call slot with reference parameters. 

 

 

- Hui

 

 

        

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090330/7dd7f4cd/attachment.html 


More information about the Qt-interest-old mailing list