我使用 PyQt6 并嘗試運行一些 qml 應用程式,它拋出module "QtQuick.XmlListModel" is not installed 錯誤?
Name: PyQt6
Version: 6.2.0
Summary: Python bindings for the Qt cross platform application toolkit
Home-page: https://www.riverbankcomputing.com/software/pyqt/
Author: Riverbank Computing Limited
Author-email: [email protected]
License: GPL v3
Location: c:\users\administrator\appdata\local\programs\python\python310\lib\site-packages
Requires: PyQt6-Qt6, PyQt6-sip
Required-by:
代碼片段
import QtQuick 2.12
import QtQuick.XmlListModel 2.12
uj5u.com熱心網友回復:
在 Qt6 中,XmlListModel 已從 QtQuick 移至 QtQml,如檔案中所示,因此您必須更改為:
import QtQuick
import QtQml.XmlListModel
注意:在 Qt6 中,您不應指明模塊的版本。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/327432.html
上一篇:如何在另一個Qt執行緒上運行它?
