Results 1 to 4 of 4

Thread: Designing Multithreaded app in Qt

  1. #1
    Join Date
    May 2009
    Posts
    23
    Qt products
    Qt4
    Platforms
    Windows

    Default Designing Multithreaded app in Qt

    I want to create multi-threaded application in Qt (GUI).

    Thread 1: Take account of all the logging.
    Thread 2: Some math calculations(worker thread).
    Thread 3: GUI

    What is the best architecture I should go for ? I will higly appreciate any pointer or code snippete

    Thanks in advance.

  2. #2
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Designing Multithreaded app in Qt

    u cant do GUI in QThreads .. QWidget is not reentrant ... so thread3 is invalid ..

    use the gui as main event loop .. from there spawn two thread
    thread1: loggings (only text, image, QTimers .,..)
    thread2: calculation algorithms ..

    best example if u are newbie to QThread is
    /examples/network/blockingfortuneclient
    because for me it looks very easy to ride the concept ..
    "Behind every great fortune lies a crime" - Balzac

  3. #3
    Join Date
    May 2009
    Posts
    23
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Designing Multithreaded app in Qt

    Thank you very much for your reply and pointer

  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: Designing Multithreaded app in Qt

    You can do 1. and 3. in the same thread. For 2. you can (but don't have to) use an external thread.

    Read the article in QQ: http://doc.trolltech.com/qq/qq27-responsive-guis.html
    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. Tools for designing a program
    By babu198649 in forum General Programming
    Replies: 2
    Last Post: 11th May 2009, 19:06
  2. Multithreaded spend CPU 100%
    By wisconxing in forum Qt Programming
    Replies: 1
    Last Post: 18th December 2008, 08:03
  3. Designing a "slide-out" effect
    By Gray in forum Qt Programming
    Replies: 1
    Last Post: 26th September 2007, 11:52
  4. multithreaded OpenGL Qt application
    By yuriy in forum Qt Programming
    Replies: 2
    Last Post: 1st September 2006, 18:54
  5. Any Toolkit for designing VisualStudio-like GUIs?
    By burn2themax in forum Qt Programming
    Replies: 11
    Last Post: 29th July 2006, 11:00

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.