2022-05-13 13:12:05 +00:00
|
|
|
// Copyright (C) 2017 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
//![0]
|
2022-08-31 07:59:05 +00:00
|
|
|
import QtQuick
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: page
|
2012-03-20 08:36:12 +00:00
|
|
|
width: 320; height: 480
|
2011-04-27 10:05:43 +00:00
|
|
|
color: "lightgray"
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: helloText
|
|
|
|
text: "Hello world!"
|
|
|
|
y: 30
|
|
|
|
anchors.horizontalCenter: page.horizontalCenter
|
|
|
|
font.pointSize: 24; font.bold: true
|
|
|
|
}
|
|
|
|
|
|
|
|
Grid {
|
|
|
|
id: colorPicker
|
|
|
|
x: 4; anchors.bottom: page.bottom; anchors.bottomMargin: 4
|
|
|
|
rows: 2; columns: 3; spacing: 3
|
|
|
|
|
|
|
|
//![1]
|
|
|
|
Cell { cellColor: "red"; onClicked: helloText.color = cellColor }
|
|
|
|
//![1]
|
|
|
|
Cell { cellColor: "green"; onClicked: helloText.color = cellColor }
|
|
|
|
Cell { cellColor: "blue"; onClicked: helloText.color = cellColor }
|
|
|
|
Cell { cellColor: "yellow"; onClicked: helloText.color = cellColor }
|
|
|
|
Cell { cellColor: "steelblue"; onClicked: helloText.color = cellColor }
|
|
|
|
Cell { cellColor: "black"; onClicked: helloText.color = cellColor }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//![0]
|