[Qt-interest] QtScript and QVariant

Christian Dähn daehn at asinteg.de
Wed Mar 3 23:14:48 CET 2010


Hi,

I'm new to QtScript (but experienced with Qt) and currently have the problem
that one of my C++ classes uses QVariant as return value,
which doesn't work in my Qt 4.5.3 scripts - all values are "undefined".

Can anybody give me a hint how to get QVariant types working in QtScript?
I already googled around for hours and searched all documentations and examples
without any success :-(

Here a simplified C++ example:

class MyClass : public QObject
{
   Q_OBJECT
public:
   MyClass(...)

public slots:
   QVariant   process();
};


Here my QtScript code:

 var data = myObject.process();
  print(typeof data);   // "undefined"

Any hints are appreciated.

ciao,
Chris

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


More information about the Qt-interest-old mailing list