好吧,从 android 转移到 blackberry 级联 qml 编码。
我想在 qml 中手动添加启动画面,时间限制为 2-3 秒。
我怎么能做到这一点,因为在 qml 中没有与时间相关的选项。
在通过网络和开发者论坛搜索时,没有任何关于这种情况的透露。
帮助!帮助!帮助!
这是我的 main.qml
import bb.cascades 1.0
import bb.myTimer 1.0 //error unknown library bb.myTimer
Page
{
Container {
layout: DockLayout {
}
onCreationCompleted: {
myTimer.start();
}
ImageView {
id: mImageViewIcon
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
imageSource: "asset:///splash1.png"
}
attachedObjects: [
QTimer { //error : The QTimer component might be an unknown or custom component. Its properties are not validated.
id: myTimer
interval: 3000
onTimeout: {
//Push New Page here
mysheet1.open();
}
},
Sheet
{
id: mysheet1
peekEnabled: false
Page
{
Container
{
background: Color.Transparent
ImageView
{
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
imageSource: "asset:///splash2.png"
}
}
}
}
]
}
}
我的 main.cpp
#include <bb/cascades/Application>
#include <QLocale>
#include <QTranslator>
**#include <Qtimer>**
#include "applicationui.hpp"
#include <Qt/qdeclarativedebug.h>
using namespace bb::cascades;
Q_DECL_EXPORT int main(int argc, char **argv)
{
Application app(argc, argv);
**qmlRegisterType<QTimer>("my.timer", 1, 0, "QTimer");**
// Create the Application UI object, this is where the main.qml file
// is loaded and the application scene is set.
new ApplicationUI(&app);
// Enter the application main event loop.
return Application::exec();
}
提前致谢。