Results 1 to 11 of 11

Thread: How to Show GUI and work on background

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to Show GUI and work on background

    Quote Originally Posted by roseicollis View Post
    Then? How can I derive from both?
    Didn't I just write that this is not possible?
    How does asking how to do it make any sense?
    Obviously there is no "how".

    Quote Originally Posted by roseicollis View Post
    Do you mean that I have to make 2 projects and then unify them with a process??
    That is an option.
    You can also have a project that contains two exectuables.
    The template for a multi target project is called "subdirs".

    Quote Originally Posted by roseicollis View Post
    If yes can you put the code or the idea more or less of it? I can't understand how can the code be.
    The idea is two have two programs:
    1) a GUI that needs to be event driven to stay responive
    2) a simple non-GUI worker program that can block until it is done

    Then have the GUI program run the non-GUI program using QProcess.

    Multi-Process is an alternative to multithreading with slightly different properties.

    Depends a lot on what that parallel task is, how much it needs to share data with the UI and how often it needs to communicate.

    Cheers,
    _

  2. #2
    Join Date
    Dec 2014
    Posts
    82
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to Show GUI and work on background

    Quote Originally Posted by anda_skoa View Post
    Didn't I just write that this is not possible?
    How does asking how to do it make any sense?
    Obviously there is no "how".
    As you said: "Since you have fixed sequence of functions, dervice from QThread and implement that sequence in its run() method."
    Though you meant I had to inherit from it too.

    I'll search more about what you think of exes Thank you!

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to Show GUI and work on background

    Quote Originally Posted by roseicollis View Post
    As you said: "Since you have fixed sequence of functions, dervice from QThread and implement that sequence in its run() method."
    Though you meant I had to inherit from it too.
    Yes, you thought correctly.
    The way to reimplement a virtual method in C++ is to overwrite it, meaning you derive from the class and implement the method again in that new class.

    Cheers,
    _

Similar Threads

  1. How to show a frameless dialog - DOESN'T WORK
    By franco.amato in forum Newbie
    Replies: 4
    Last Post: 2nd June 2010, 17:21
  2. Replies: 2
    Last Post: 21st March 2010, 08:20
  3. Replies: 5
    Last Post: 16th December 2009, 11:33
  4. background-image on QLabel does NOT work
    By VireX in forum Newbie
    Replies: 2
    Last Post: 8th June 2007, 20:30
  5. aLabel->show() does not seem to work
    By nass in forum Qt Programming
    Replies: 2
    Last Post: 18th September 2006, 14:42

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
  •  
Qt is a trademark of The Qt Company.