How can i create QML canvas in my C++ code and attach video on that? Such as Java Canvas i can
How to create QML su开发者_开发知识库ch canvas, and attach XOverlay video object on that canvas?
Java:
final Canvas canvas = new Canvas();
canvas.setPreferredSize(new Dimension(200, 200));
XOverlay.wrap(video).setWindowID(canvas);
C++
#include <QtGui/QApplication>
#include "qmlapplicationviewer.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QmlApplicationViewer viewer;
viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
viewer.setMainQmlFile(QLatin1String("qml/QmlTest1/main.qml"));
// set the window no border, to do full screen live VIDEO
viewer.setWindowFlags(
Qt::CustomizeWindowHint |
Qt::FramelessWindowHint
);
viewer.showExpanded();
return app.exec();
}
My ref:
http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeexamples.html
http://www.scriptol.com/programming/qml.php
Video playback in QML can be done through Qt Mobility's Video element: http://doc.qt.nokia.com/qtmobility-1.2/qml-video.html
精彩评论