代码是这样写的
ui->quickWidget->setResizeMode(QQuickWidget::SizeRootObjectToView);
QUrl source("qrc:/qml/qml/Dimensional3RoboticArm.qml");
ui->quickWidget->setSource(source);
没有什么问题,但是换到另一台电脑上编译运行的时候出现一个警告:qrc:/qml/qml/Dimensional3RoboticArm.qml: File was compiled ahead of time with an incompatible version of Qt and the original file cannot be found. Please recompile,两台电脑的编译环境是一样的。
解决方法:使用windeployqt xxx.exe -qmldir 重新打包