Skip to content

Instantly share code, notes, and snippets.

@amfasis
Created August 21, 2019 07:29
Show Gist options
  • Save amfasis/8f35d1b1c09a3f5ef06cd042f83be109 to your computer and use it in GitHub Desktop.
Save amfasis/8f35d1b1c09a3f5ef06cd042f83be109 to your computer and use it in GitHub Desktop.
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.5
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
Timer {
interval: 1000
running: true
repeat: false
onTriggered: {
listview.model = list
timer2.running = true
}
}
Timer {
id: timer2
interval: 1000
running: false
repeat: true
onTriggered: list.append({"title": "add"})
}
ListModel {
id: list
ListElement { title: "test1" }
ListElement { title: "test 2" }
ListElement { title: "test 3" }
}
ListView {
id: listview
anchors.fill: parent
populate: Transition {
id: _popuTrans
SequentialAnimation {
PropertyAction { property: "scale"; value: 0.0 }
PauseAnimation { duration: 500 * _popuTrans.ViewTransition.index }
NumberAnimation { property: "scale"; from: 0.0; to: 1.0; duration: 2000; easing.type: Easing.InOutQuad }
}
}
add: Transition {
NumberAnimation { property: "scale"; from: 0; to: 1.0; duration: 4000 }
}
delegate: MenuItem {
text: model.title
width: parent.width
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment