QML Object Type is not a type error in QTCreator

后端 未结 4 1333
无人及你
无人及你 2021-02-20 10:01

Hi Everyone i am new to QT and i am having trouble loading one qml through another qml Basically i have created a qml MyTabView(MyTabView.qml)

 import QtQuick 2.         


        
4条回答
  •  太阳男子
    2021-02-20 10:36

    I had a similar problem.

    qrc:AGview.qml:8:15: AGraph is not a type

    I solved it: my original code (in my main.cpp):

    view.setSource(QUrl("qrc:AGview.qml"));
    

    the working one:

    view.setSource(QUrl("qrc:/AGview.qml"));
    

    I think without the slash it don't search in the actual folder.

提交回复
热议问题