Results 1 to 4 of 4

Thread: Display from multiple processes in one GUI

  1. #1
    Join Date
    Feb 2009
    Posts
    24
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Display from multiple processes in one GUI

    I'm working on an app that communicates with different pieces of hardware and displays graphics based on the hardware outputs. The hardware can be a bit flakey, though. I'd like to structure the main app so that, like Chrome, each graphics display is it's own process, so that one crashing doesn't bring down the entire app. While the easiest solution would be to just have a different QMainWindow for each piece of hardware, each one started by a QProcess, the inputs from the hardware are synced. Because of that, it would be nice to have them side-by-side in one main window.

    Any suggestions on the best way to run GUI elements from different processes within one main window?

    Thanks.

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    15
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default Re: Display from multiple processes in one GUI

    Hi there,

    Have you looked at the QmdiArea class? This allows you to view multiple documents in a single window, you may be able to use this for you application.
    http://doc.trolltech.com/4.3/qmdiarea.html

    Cheers
    Jim

  3. #3
    Join Date
    Feb 2009
    Posts
    24
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Display from multiple processes in one GUI

    Jim,

    That could cover the display aspect, but there's still the issue of getting the GUI element from the child element (which is actually a separate process) to draw inside the main window. I've got a feeling that QSharedMemory might be part of the solution, but I've never used it and am trying to get a feel for how to use it correctly.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Display from multiple processes in one GUI

    QSharedMemory might be a suitable solution but only if the images are simple or of constant size. If you want to have things such as resizing the main window, QSharedMemory might become a burden because of a varying size of the data to transfer (although still possible to use). If you're targeting Linux and Windows, DBus would be the best solution (although it would require of you to deploy DBus on the Windows system). Apart from that the simplest solution I can think of is a socket (UDP or local) and QDataStream to stream through images.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QProcess Bash in Event Filter (Multiple Processes)
    By Arsenic in forum Qt Programming
    Replies: 1
    Last Post: 8th November 2008, 08:42
  2. Display only PNG image on desktop
    By durbrak in forum Qt Programming
    Replies: 32
    Last Post: 15th March 2008, 21:55
  3. Qt on X11 with multiple display connections?
    By grenoble in forum Qt Programming
    Replies: 1
    Last Post: 25th February 2008, 12:44
  4. Display multiple Images in a widget
    By jeetu_happy in forum Qt Programming
    Replies: 2
    Last Post: 7th March 2007, 11:24
  5. Replies: 1
    Last Post: 6th March 2007, 15:27

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.