开发者

Qt and JavaScript mapping data

What is the correct way to map Qt data types in JavaScript. I pass a Qt object to JavaScript that I load in the QWebView control. It's not a problem to call an object method from JavaScript if there's no parameters buf if a method has parameters the code doesn't work. For example I have the structure Location:

struct Location
{
    QString country;
    QString city;
};

I have the method:

void UpdateLocation(const Location& loc开发者_StackOverflowation);

How to call this method from JavaScript?


How to call this method from JavaScript?

Location should inherit from QObject

struct Location : pubilc QObject {
Q_OBJECT

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜