|
import QtQuick 1.1 Rectangle { id: page width:500; height:200 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 Cell { cellColor: "red"; onClicked: helloText.color = cellColor } 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 } }} 第二个 import QtQuick 1.1 Item{ id: container property alias cellColor: rectangle.color signal clicked(color cellColor) width:40; height:25 Rectangle { id: rectange border.color: "red" anchors.fill: parent } MouseArea { anchors.fill: parent onClicked: container.clicked( container.cellColor) }}不知道是哪里出了 问题。 显示出是一屏白色的,什么也 没有。         求解,本人刚学习qt,不知道为什么会出现这种 错误。
|