Results 1 to 7 of 7

Thread: QThread and GUI

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2012
    Posts
    173
    Thanks
    48
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QThread and GUI

    Hello,

    I am trying to use QThread with GUI application, so the GUI wont stall on me.

    in th GUI, i have a window through witch i load a Txt file and parse it and do processing on it, they are in this manner

    Qt Code:
    1. loadFile (... )
    2. {
    3. readFile(..);
    4. parseFile(..);
    5. prossValues(...);
    6. }
    To copy to clipboard, switch view to plain text mode 

    when i run the loadFile slot, it takes long time, and the GUI stalls.

    what i did so far, is

    I sub-classed the QThread,
    override the run method and,
    emit a signal called loadFile(). in the run method.


    In the class where i need to load the file ,
    I create a mythread and,
    connect the loadFile signal to a loadFile slot.

    the the signal triggers fine and i load the file, but the gui still stalls,
    which i think it means that im still running on the main thread. not on the thread i created.

    so, Please let me know what im missing and what the mistake im making and how can i fix it.

    Thanks

    Jesse.
    Last edited by jesse_mark; 11th January 2013 at 18:48.

Similar Threads

  1. Replies: 1
    Last Post: 4th October 2012, 14:49
  2. Need a little help with QThread
    By Slewman in forum Qt Programming
    Replies: 4
    Last Post: 15th March 2010, 20:04
  3. Replies: 4
    Last Post: 26th June 2008, 18:41
  4. Spawn a QThread in another QThread
    By david.corinex in forum Qt Programming
    Replies: 2
    Last Post: 19th December 2007, 12:54
  5. QThread?
    By vishal.chauhan in forum Newbie
    Replies: 4
    Last Post: 26th March 2007, 13:43

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.