Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Felgo 3.0
- import QtQuick 2.0
- import QtQuick.Controls 2.4 as QQ2
- App {
- id: app
- // You get free licenseKeys from https://felgo.com/licenseKey
- // With a licenseKey you can:
- // * Publish your games & apps for the app stores
- // * Remove the Felgo Splash Screen or set a custom one (available with the Pro Licenses)
- // * Add plugins to monetize, analyze & improve your apps (available with the Pro Licenses)
- //licenseKey: ""
- function generateRandomColor()
- {
- var randomColor = "#"
- for(var i = 0; i !== 3; ++i){
- randomColor = randomColor + (Math.floor(Math.random() * 255)).toString(16)
- }
- console.log(randomColor)
- return randomColor
- }
- Rectangle{
- id: rect
- width: parent.width
- height: dp(40)
- color: "red"
- }
- ListModel{
- id: listModel
- }
- Component.onCompleted: {
- for(var i = 0; i !== 50; ++i){
- listModel.append({"colorText": generateRandomColor(), "index": i})
- }
- }
- ListPage{
- anchors.top: rect.bottom
- model: listModel
- delegate: Rectangle{
- height: dp(30)
- width: parent.width
- color: colorText
- Text{
- anchors.fill: parent
- text: index
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement