关于定时器
各位大神,我想在QML文件中使用定时器,但是import后,页面中什么都不显示,帮忙看看什么问题,代码如下:
我在cpp中注册了qmlRegisterType<QTimer>("timer", 1, 0, "QTimer");
然后在qml文件中
import bb.cascades 1.0
import timer 1.0
// creates one page with a label
Page {
Label {
text: qsTr("Hello World")
textStyle.base: SystemDefaults.TextStyles.BigText
verticalAlignment: VerticalAlignment.Center
horizontalAlignment: HorizontalAlignment.Center
}
}
运行后界面上面什么都没有,为什么那个hello world 的label显示不了 ,求指教,谢谢!