【发布时间】:2018-07-13 09:54:42
【问题描述】:
class A{
QList<B *>child;
Q_INVOKABLE B * getChild(int idx) {return child.at(idx);}
}
class B{
int age;
}
in QML:
Item{
A{
id: a;
}
Componet.onCompleted:{
console.log: a.getChild(0).age;
}
}
我有两个班级 A 和 B。 我已经注册了 A 类和 B 类 int main.cpp。 我可以得到正确的值,但我希望在 a.getChild(0) 之后,如果我不知道 B 类有什么属性,我能够通过点表示法获得提醒。
【问题讨论】:
标签: properties qml qlist