Advertisement
Guest User

Untitled

a guest
Apr 18th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 1.04 KB | None | 0 0
  1. import QtQuick 1.0
  2.  
  3. Rectangle {
  4.     width: 372
  5.     height: 372
  6.     MouseArea {
  7.         anchors.fill: parent
  8.         onClicked: {
  9.             Qt.quit();
  10.         }
  11.     }
  12.  
  13.     XmlListModel {
  14.         id: thumbListModel
  15.         source: "http://api.blipfoto.com/get/view/?api_key=0cb7ce000308de5c626a9d843ce8f6c4&view=date&max=90"
  16.         query: "/blipapi/data/item"
  17.  
  18.         XmlRole {
  19.             name: "thumbUrl"
  20.             query: "thumbnail/string()"
  21.         }
  22.     }
  23.  
  24.     Component {
  25.         id: thumbGridCell
  26.         Rectangle {
  27.             width: parent.width/3
  28.             height: parent.width/3
  29.             color: "#808080"
  30.             Image {
  31.                 source: thumbUrl
  32.                 anchors.fill: parent
  33.                 anchors.margins: 0.5
  34.                 clip: true
  35.             }
  36.         }
  37.     }
  38.  
  39.     GridView {
  40.         id: thumbGrid
  41.         cellWidth: parent.width/3
  42.         cellHeight: parent.width/3
  43.         model: thumbListModel
  44.         delegate: thumbGridCell
  45.         anchors.fill: parent
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement