标题:我哪里写错了吗?
作者:shizhanbiao
日期:2013-08-26 15:27
内容:
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:colorPickerx:4;anchors.bottom: page.bottom;anchors.bottomMargin: 4rows:2;columns: 3;spacing: 3
Cell { [ ..
#1 [tompsontan 08-26 17:06]
你这个Cell是什么东东?全部代码都贴出来了吗?是不是少了Cell.qml
#2 回 楼主(shizhanbiao) 的帖子 [tompsontan 08-26 17:12]
你是按这个来做的吧?
#3 [realfan 08-27 15:52]
Cell就是Cell.qml文件,定义了矩形块
#4 [realfan 08-27 15:55]
Cell.qml
import QtQuick 1.1 //( 可以改成import QtQuick 2.0,根据你的环境)
Item {
id: container
property alias cellColor: rectangle.color
signal clicked(color cellColor)
width: 40; height: 25
Rectangle {
id: rectangle
border.color: "white"
anchors.fill: parent
}
MouseArea {
anchors.fill: parent
onClicked: container.clicked(container.cellColor)
}
}
#5 [wuming123057 08-27 16:03]
Cell.qml文件中
Rectangle {
id:rectange
少加一个字母l,应该为rectangle,其他的问题没有