Results 1 to 2 of 2

Thread: What is the best way to wait for a response from another application?

  1. #1
    Join Date
    May 2010
    Posts
    53
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default What is the best way to wait for a response from another application?

    I am building an application for my graduate research that processes 3D scans of real-world objects, but unfortunately the scanning software required to control the scanning hardware is proprietary and it has no SDK or way to control it from the command line.

    The application I am building is basically a wizard that walks the user through setting some parameters for post-processing the scan, then calls the external scanning software using QDesktopServices. I would like my application to monitor a folder and then return control and load the file saved to that folder by the 3rd party software. I am able to monitor the folder using QSystemFileWatcher which issues a SIGNAL once a file is modified in the directory.

    My question is what is the best way to have my application wait in the background until a file is saved? My first thought was to have a while loop with a sleep() and processEvents() call. The SLOT called by the QSystemFileWatcher would then break the while loop. I think this would work but I just thought somebody would know a better way on how to approach this.

    Thanks.

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: What is the best way to wait for a response from another application?

    All Qt applications run at least one event loop, so just wait for the signal. No need to use a while loop, sleep calls or processEvents.

Similar Threads

  1. wait the application for some time..
    By mohanakrishnan in forum Qt Programming
    Replies: 3
    Last Post: 9th December 2009, 08:22
  2. response from mail server
    By zakis in forum Qt Programming
    Replies: 4
    Last Post: 25th September 2009, 05:32
  3. Reqest and Response in XML
    By srohit24 in forum Qt Programming
    Replies: 28
    Last Post: 4th July 2009, 07:57
  4. Replies: 1
    Last Post: 14th June 2007, 15:52

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.