0
在C++类我有这样的事情(我已经尝试不同的东西):如何在QML中声明Qt.points数组?
class X : public QObject {
Q_OBJECT
public:
Q_INVOKABLE void save(int _n, QObject *_points);
我在QML文件中尝试这样做,但它这么想的编译:
property var Qt.point points: []
我想通过从QML此阵列(在JavaScript函数),以C++函数是这样的:
x.save(root.points.length, root.points)
如果我声明点是这样的:
property var points: []
C++函数被调用,但是points为NULL。