If you're loading from a local file, then set the QQmlComponent to load synchronously by specifying it in the constructor:QQmlComponent component(view.engine(), QUrl::fromLocalFile("MyItem.qml"), QQmlComponent::PreferSynchronous ); 这篇关于如何使用C ++创建Qml组件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-24 01:28