看到我从qt creator收到的错误消息了吗
我现在正在学习qt creator。
当我点击run按钮时,它会显示错误
以下是main.qml文件的源代码:
# THis is main.qml file
import QtQuick 2.12
import QtQuick.Window 2.12
Window {
width: 640
height: 480
visible: true
title: qsTr("Hello World")
}
# This is the main.py file
# This Python file uses the following encoding: utf-8
import sys
import os
from PySide2.QtGui import QGuiApplication
from PySide2.QtQml import QQmlApplicationEngine
if __name__ == "__main__":
app = QGuiApplication(sys.argv)
engine = QQmlApplicationEngine()
engine.load(os.path.join(os.path.dirname(__file__), "main.qml"))
if not engine.rootObjects():
sys.exit(-1)
sys.exit(app.exec_())
# This is main.pyproject file
{
"files": ["main.py", "main.qml"]
}
1条答案
按热度按时间tv6aics11#
终于找到答案了!,我的qtquick动态链接库已经存在了,它没有损坏,问题是当我在qt创建一个项目时,我选择了pyside的较低版本!
堆栈溢出你们应该做的是,当创建一个新的项目时,选择pyside的最新版本并创建您的项目!