Cut a program in three files QML (Model / View / Controller)

  • I want to separate my program in 3 QML files for have 1 QML file that contains the data model (XMLlistModel), another that includes the views (ListView), and the third to launch the program tank you for your help
    @import QtQuick 1.0

    Item {

    width: 800
    height: 480
    XmlListModel {
        id: forecastModel
        source: ""
        query: "/xml_api_reply/weather/forecast_information"
        XmlRole { name: "city"; query: "city/@data/string()" }
    ListView {
        x: 145; y: 325; width: 594; height: 48;
        model: forecastModel
        delegate: Text {
   "Univers LT Std"; color: "#c8c8c8"; width: parent.width; font.pixelSize: 30
            text: city
            anchors.centerIn: parent.centerIn


  • Dublicate. Closed.
    "First thread":

Log in to reply

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