Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mport QtQuick 2.15
- Rectangle {
- //anchors.fill: parent
- width: 300
- height: 400
- Component {
- id: myDelegate
- Rectangle {
- id: content
- anchors { left: parent.left; right: parent.right }
- height: myText.implicitHeight + 4
- border.width: 1
- border.color: "lightsteelblue"
- Text {id:myText; text: message ; width:parent.width; wrapMode: Text.WordWrap}
- }
- }
- Rectangle{
- border.color: "blue"
- width:400
- height: 200;
- anchors.centerIn: parent
- ListView {
- id: view
- anchors { fill: parent; margins: 2 }
- model: messagesModel
- delegate: myDelegate
- //spacing: 4
- //clip: true
- orientation: ListView.Horizontal
- }
- }
- ListModel {
- id:messagesModel
- ListElement {
- message: "Lorem "
- }
- ListElement {
- message: "ipsum"
- }
- ListElement {
- message: "dolor"
- }
- ListElement {
- message: "sit"
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement