• 4609阅读
  • 0回复

[讨论]我的代码哪里出了问题。怎么显示不出来效果呢。 [复制链接]

上一主题 下一主题
离线shizhanbiao
 
只看楼主 倒序阅读 楼主  发表于: 2013-08-26
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,不知道为什么会出现这种错误
快速回复
限100 字节
 
上一个 下一个