Results 1 to 2 of 2

Thread: Could a process running in background mode interact with the GUI??

  1. #1
    Join Date
    Feb 2010
    Posts
    64
    Thanks
    18
    Qt products
    Qt4
    Platforms
    Windows

    Default Could a process running in background mode interact with the GUI??

    Hi everyone,

    Thanks in advance!!

    I'm trying to execute a function in background mode:
    Qt Code:
    1. QFuture<void> future = QtConcurrent::run(this, &MainWindow::myFunction); //myFunction has no input parameters, and returns void
    To copy to clipboard, switch view to plain text mode 
    The problem is that, if myFunction doesn't interact with the GUI, then it works. But if it interacts with some element shown on the main window (like a graph, to replot it) then a running time error is thrown.

    Is it a normal behavior? How could I execute a function in background mode that interacts with elements on the GUI?

    Thank you!

  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: Could a process running in background mode interact with the GUI??

    It's normal behavior. Use signals/slots to interact with the main thread which will then interact with the elements on the GUI on the other threads behalf.

  3. The following user says thank you to squidge for this useful post:

    locke (19th March 2010)

Similar Threads

  1. Replies: 4
    Last Post: 9th November 2009, 21:12
  2. Destroyed while process is still running
    By qtzcute in forum Qt Programming
    Replies: 5
    Last Post: 23rd July 2009, 08:26
  3. Replies: 1
    Last Post: 18th May 2009, 09:49
  4. Connecting with QProcess to an already running process
    By high_flyer in forum Qt Programming
    Replies: 7
    Last Post: 26th November 2007, 10:31
  5. Check wheter a process is running
    By Lele in forum Qt Programming
    Replies: 1
    Last Post: 15th June 2006, 12:35

Tags for this Thread

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.