.qmlproject file question



  • What is the syntax for specifying that my qml files are both in the root directory and a subdirectory named components in the .qmlproject file.

    @/* File generated by QtCreator */

    import QmlProject 1.0

    Project {
    /* Include .qml, .js, and image files from current directory and subdirectories /
    QmlFiles {
    directory: "." //need to know how to add components folder here
    }
    JavaScriptFiles {
    directory: "."
    }
    ImageFiles {
    directory: "../Images"
    }
    /
    List of plugin directories passed to QML runtime */
    // importPaths: [ "../exampleplugin" ]
    }
    @



  • Well, I don't know it. But it's interesting that all examples in Qt declare as directories for qml files only the current directory, although many of them have qml files in subdirectories and Qt Creator still find them. Maybe one only has to declare the root directory.

    Nevertheless, if a .qmlproject file uses the same syntax as a general qml file, then you can specify more than one directory in this manner:

    @
    QmlFiles {
    directory: [ 'a directory', 'another directory']
    }
    @


Log in to reply
 

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