I want to have a single Qt application showing two windows on different display outputs(screens) on my Ubuntu 14.04 computer. Does someone know how to do that?
The documentation of Qt for embedded linux is what I could find so far but it did not help me really.
Edit: Based on your comments, I've done this but it doesn't work as it should:
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQuickView view1(QUrl(QStringLiteral("qrc:/Screen1.qml")));
qDebug() << app.screens().length();
QScreen* screen1 = app.screens().at(0);
QScreen* screen2 = app.screens().at(1);
view1.setGeometry(0,0,200,200);
view1.setScreen(screen1);
view1.show();
QQuickView view2(QUrl(QStringLiteral("qrc:/Screen2.qml")));
view2.setGeometry(0,0,200,200);
view2.setScreen(screen2);
view2.show();
return app.exec();
}
The debug output is: 2
This code is putting both views to the same display output, although the qDebug
output gives the correct number of display outputs with correct names.