c++ - 通过 id 或 objectName 在 qml 中查找对象
问题描述
如何通过 objectName 或 id 在 qml 中找到元素?我想实现类似的功能
Item {
id: myItem
}
MyItemClass {
onStart: {
myclass.add_new_obj (myItem.toString)
}
onJobDone: {
item_qml_id.width = width_qml
// here item_qml_id = Item_QMLTYPE_111(0x1ee54f12312), can i find object using this value?
}
}
我在 C++ 中的信号看起来像:
void jobDone(QString item_qml_id, int width_qml)
解决方案
推荐阅读
- python - 将库导入 Python 文件
- postgresql - postgresql/pgAdmin - 接受 start_date 和 end_date 参数作为查询运行的输入
- visual-studio-code - 该进程试图写入一个不存在的管道
- python - 调试 Python 时调用 Stack empty
- python - 减少创建 BeautifulSoup 对象时的开销
- amazon-aurora - Postgres (AWS Aurora) 未强制执行唯一索引/约束
- java - 如何删除重复项?
- javascript - twitter api 流用户的主页时间线
- c++ - 在构造 std::variant 时禁用从指针类型到 bool 的隐式转换的最佳方法是什么?
- flutter - 如何从异步源构建元素并在 Flutter 中的后续调用中更新它们?