Skip to content

Instantly share code, notes, and snippets.

@rominf
Created May 22, 2018 08:38
Show Gist options
  • Save rominf/a63c9892e5c7a811b7934b5f2ed6e65d to your computer and use it in GitHub Desktop.
Save rominf/a63c9892e5c7a811b7934b5f2ed6e65d to your computer and use it in GitHub Desktop.
import QtQuick 2.9
import QtQuick.Controls 2.1
import QtQuick.Window 2.2
Window {
id: window
visible: true
width: 640
height: 480
title: qsTr("Hello World")
ListView {
id: view
height: 48
delegate: TextField {
text: modelData
}
model: ListModel {
id: model
ListElement {
modelData: "test"
}
}
}
Button {
anchors.top: view.bottom
onClicked: {
window.title = model.get(0).modelData;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment