Results 1 to 20 of 21

Thread: processEvents() and threads

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2007
    Posts
    40
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Default Re: processEvents() and threads

    Quote Originally Posted by talk2amulya View Post
    well, i cant move the heavy processing code to another thread cuz there are lots of gui calls in it..and a thread cant have gui calls..i think this problem can only be solved if i get to process events of main thread from another thread..for which i couldnt find an api..any other pointers?
    does this heavy processing function call the GUI elements directly? would it not be possible to, in some way, decouple the function and the GUI elements?
    because, if it is not the case, we have a simple issue of a function which takes a lot of time being invoked in a thread! and obviously the thread does nothing but execute the function for a long time!!!
    Let your work talk for you

  2. #2
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 66 Times in 62 Posts

    Default Re: processEvents() and threads

    THATS the reason why i was trying to call processEvents() from another thread, thinking it would solve my problem..but evidently it doesnt save my life..

  3. #3
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    70
    Thanked 59 Times in 57 Posts

    Default Re: processEvents() and threads

    Hi,

    Can you try to add "processEvents" calls into the process function? If you have a loop, you can add it to be called every loop iteration, ...
    Òscar Llarch i Galán

  4. #4
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 66 Times in 62 Posts

    Default Re: processEvents() and threads

    well, i mentioned it before also..i have tried that and that does work..although the loading icon animates intermittently..but it definitely moves..but i've been asked to find "another" way of doing it..and now i m coming to the conclusion that perhaps it cant be done in any other way, if i m not missing anything that QT provides and i m not aware of or u guys are not aware of...

  5. #5
    Join Date
    Dec 2007
    Posts
    40
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Default Re: processEvents() and threads

    this had to be! managerial decisions on how the code should execute (not meant against anyone, but I have had a fair share of these kind of things myself!!!)...
    but may be there is no way this can be achieved, unless ofcourse there is some obscure hard-to-find feature somewhere hidden in qt!!!
    Let your work talk for you

Similar Threads

  1. Once more: Threads in Qt4
    By high_flyer in forum Qt Programming
    Replies: 5
    Last Post: 9th August 2006, 19:35

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.