QScreen for KTV multi-screen application problem.
-
I am developing a KTV software in ubuntu. when program start, we need detect if the TV screen has add via VGA line. and show the video to TV screen. also the PC for operating songs has another video play interface.
So, I create two QtQuick2ApplicationViewer as blew, I am not sure it is right to do this.
@
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);int screenwidth = QGuiApplication::primaryScreen()->size().width(); int screenheight = QGuiApplication::primaryScreen()->size().height(); QtQuick2ApplicationViewer viewer; viewer.rootContext()->setContextProperty("msg",themeuse); viewer.rootContext()->setContextProperty("screenwidth",screenwidth); viewer.rootContext()->setContextProperty("screenheight",screenheight); viewer.setMainQmlFile(QStringLiteral("qml/linuxktv/main.qml")); // viewer.showExpanded(); viewer.showFullScreen(); QObject *player = viewer.findChild<QObject*>("player"); QtQuick2ApplicationViewer viewer2; viewer2.rootContext()->setContextProperty("player",player); viewer2.setMainQmlFile(QStringLiteral("qml/linuxktv/main2.qml")); viewer2.setGeometry(1440,24,1920,1056); viewer2.showFullScreen(); viewer2.setFlags(Qt::WindowStaysOnTopHint); return app.exec();
}
@And my question is: how to sync video within two screen,also is how to share a video object with two viewers?
many thanks.