Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.4
- import QtQuick.Controls 1.3
- import QtQuick.Controls.Styles 1.2
- import QtQuick.Window 2.2
- import QtQuick.Dialogs 1.2
- import "QMLs"
- ApplicationWindow {
- id: mainWindow
- objectName: "mainWindow"
- title: qsTr("Hello World")
- width: 290
- height: 420
- visible: true
- Button {
- id: btnRequest
- objectName: "btnRequest"
- width: mainWindow.width - 10
- height: 40
- x: 5
- y: mainWindow.height - height - 5
- anchors.horizontalCenter: mainWindow.width / 2
- style: ButtonStyle {
- background: FuncMenuButtonB {}
- label: ButtonLabel { text: "Список друзей, пожалуйста" }
- }
- onClicked: backend.makeRequest(140861342)
- }
- ListView {
- function clear() {
- lvList.model.clear()
- }
- function append(newElement) {
- lvList.model.append(newElement)
- }
- id: lvList
- objectName: "lvList"
- anchors.margins: 5
- width: parent.width
- height: mainWindow.height - btnRequest.height - 5
- clip: true
- spacing: 8
- model: ListModel {}
- delegate: Rectangle {
- width: lvList.width
- height: lvList.height / 6
- color: "#00AAAA"
- Image {
- id: lvImage
- objectName: "lvImage"
- anchors.margins: 3
- width: height
- height: parent.height
- source: userAva
- }
- MouseArea {
- anchors.fill: parent
- onClicked: console.log("ListView el#" + index + " clicked!")
- }
- Text {
- id: lvLabel
- objectName: "lvLabel"
- x: lvImage.height
- anchors.centerIn: parent
- text: userName
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement