Synchronizing multiple Qt/QML Applications
-
Hi,
I was thinking wether it was viable to have multiple Qt/QML applications ( possibly running on different computers ) synchronized together.
My idea was to have a videowall application, where each monitor was driven by a single computer ( embedded solution ), all rendering the same Qt/QML application but each rendering a different portion of it and all being synchronized together.
I really new to Qt/QML development and wanted to have some hints from the community.Thanks
Massimo -
Hi and welcome to devnet,
You would have to use some form of IPC to keep things in sync. Since you have one computer per screen, a network solution is the most likely. Something using i.e. QTcpServer and QTcpSocket.
Hope it helps
-
Thanks,
Definitely some kind of IPC has to be setup for keeping in sync the various computers. Before entering in the sync part I was also investigating wether it was possible to define different coordinate systems for each monitor. For example, if I have a setup with two 1280x720 monitors side by side ( horizontally) to achieve an virtual 2560x720 resolution, and then I have two qml files running on each computer. First computer is no problem since it has the drawing area 1280x720, on the second instead I would like to have the coordinate system translated by 1280 on the x-axis, so that it will start drawing from 1280 to 2560... I'm starting to experiment with the
transform: Translate { x: ... }
command... Wanted to know it you think this is the correct approach in changing the coordinate system.
My QML on the second monitor looks something like this:Rectangle {
id: screenwidth: 1280 height: 720 transform: Translate { x: -1280 }
...
...}
The -1280 translation should achieve the nothing is drawn on the screen unless its x coordinate is > 1280.
Massimo
-
This would then mean that each embedded computer will have the same qml file and only render a part of it ?
An alternative would be that each of your embedded systems would only act as screen like a multi-head computer setup (thin client comes to my mind but it's not exactly that). You main computer would then render one big qml file across all the screens connected.
-
Yes the idea is to have the same qml file ( more or less - I'm still investigating if this is possible ) on each device and each device renders the part for its screen.
I think this is easily achievable when the qml has static parts and no animation. I trying to figure out how to make it work when you have animation, simple example: a square that moves horizontally from one to screen to the next...In my example I have a timer that every second moves the rectangle of 10pixel to the right, to make everything work I need to have the two timers of the two devices synchronized... and this is what I'm trying to look in the sources of Qt....
Your idea could be a solution, do you think its feasible? The problem is that when you have a big videowall ( 3x3 or 4x4 ) I don't think a single computer has the power to render at a decent frame rate the whole setup..