Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Cut a program in three files QML (Model / View / Controller)

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

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 2.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yassine26
    wrote on last edited by
    #1

    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: "http://www.google.com/ig/api?weather=&hl=fr"
        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 {
            font.family: "Univers LT Std"; color: "#c8c8c8"; width: parent.width; font.pixelSize: 30
            text: city
            anchors.centerIn: parent.centerIn
        }
    }
    

    }@

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DenisKormalev
      wrote on last edited by
      #2

      Dublicate. Closed.
      "First thread":http://developer.qt.nokia.com/forums/viewthread/7088/

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved