"网络错误"导入QML文档时

时间:2015-04-08 12:09:18

标签: android qt import qml material-design

我正在尝试从本地目录导入qml-material。标准导入行import "/path/to/the/material/folder/" as Material不起作用。 Material命名空间具有RaisedButton类型,当我像Material.RaisedButton { ... }一样使用它时,它会给出错误,如标题中所述。

完整的QML文档:

import "/home/imran/Downloads/material-master/qml/material/" as Material

ApplicationWindow {
    id: root
    title: qsTr("Hello World")
    width: 1080
    height: 1920
    color: "#ffffff"
    visible: true                                         

    Material.RaisedButton {
        id: materialButton
        anchors.horizontalCenter: parent.horizontalCenter
        text: 'Material D'
    }
}

完整日志:
W/Qt (20508): (null):0 ((null)): QQmlApplicationEngine failed to load component W/Qt (20508): (null):0 ((null)): qrc:/main.qml:43 Type Material.RaisedButton unavailable W/Qt (20508): /home/imran/Downloads/material-master/qml/material/RaisedButton.qml:-1 Network error W/Qt (20508):

0 个答案:

没有答案