I can not import anything in qml



  • good, I'm doing a port from qt 4.8 to 5.10. what the program does is open other programs made in qml and javascript.
    start with a qml with the wallpaper and import a panel similar to windows 7

    Rectangle { //Panel personalizado
        Loader {source: "temas/"+tema+"/panel/panel.qml"}
    }
    

    in that qml if it works when I want to import

    import "componentCreation.js" as MyScript
    

    from there I can open the "programs" but those that have to import something throw the following error. example:

    import "content"
    import "content/calculator.js" as CalcEngine
    

    gives the following error

    "file:qml/aplicaciones/calqlatr/calqlatr.qml:52:1: import "content" has no qmldir and no namespace"

    I do not understand why with the panel it works and with the rest of the qml

    I leave a video of the program running in symbian with qt 4.8
    https://www.youtube.com/watch?v=C4aJ_J401Qc&t=2s

    original:
    buenas, estoy haciendo un port de qt 4.8 a 5.10. lo que hace el programa es abrir otros programas hechos en qml y javascript.

    Rectangle { //Panel personalizado
        Loader {source: "temas/"+tema+"/panel/panel.qml"}
    }
    

    en ese qml si funciona cuando quiero importar

    import "componentCreation.js" as MyScript
    

    desde ahi puedo abrir los "programas" pero los que tengan que importar algo tiran el siguiente error, ejemplo:

    import "content"
    import "content/calculator.js" as CalcEngine
    

    devuelve el error:

    "file:qml/aplicaciones/calqlatr/calqlatr.qml:52:1: import "content" has no qmldir and no namespace"

    no entiendo porque con el panel si funciona y con el resto de qml no

    les dejo un video del programa funcionando en symbian con qt 4.8
    https://www.youtube.com/watch?v=C4aJ_J401Qc&t=2s



  • @Dante-Leoncini

    import "content" has no qmldir and no namespace"

    it seems to have issues with qmldir file(s). You may want to take a look at the documentation



  • try to create a qmldir file, but it did not work

    look for the error but I found nothing that serves me. I do not know if it has to do with the fact that I'm not using a qrc file.

    in the ".pro" file, add a line to copy and paste the "qml" folder into the compiled directory. that's because I want the code jv and qml can be edited with any editor in the final version

    #Copia la carpeta "qml" dentro de la carpeta build
    copydata.commands = $(COPY_DIR) $$PWD/qml $$OUT_PWD
    first.depends = $(first) copydata
    export(first.depends)
    export(copydata.commands)
    QMAKE_EXTRA_TARGETS += first copydata
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.