首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > QT开发 >

请问QML的基本有关问题

2012-06-06 
请教QML的基本问题呵呵 有时间研究QML了问个基本问题在C++中C/C++ codemywidget** w mywidget[20].....m

请教QML的基本问题
呵呵 有时间研究QML了问个基本问题
在C++中 

C/C++ code
mywidget** w= mywidget[20];.....

mywidget是QWiget的一个子类
一般如果我显示一个我就隐藏其他的 有一些操作来设定那个显示,其他隐藏

我想问的是QML怎么实现的

如果有几个相互平行的QML文件 如果控制他们的显示问题?

xiachm 大侠来指导下

其他大仙也来指导指导。

[解决办法]
用一个属性来控制就可以。
C/C++ code
import QtQuick 1.0Rectangle {    width: 360    height: 640    property int current: 0    Timer {        id: timer        interval: 1000        running: true        repeat: true        onTriggered: {            if (current++ == repeater.count - 1) current = 0        }    }    Repeater {        id: repeater        model: 10        Rectangle {            y: index * 100            width: 80            height: 80            color: "green"            visible: current == index        }    }} 

热点排行