Results 1 to 5 of 5

Thread: Problem with getting QFuture and QFutureWatcher working properly

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2013
    Posts
    3
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Problem with getting QFuture and QFutureWatcher working properly

    That is a bunch of good advice. Thanks for that. How can I use some method every minute though and not hold up the rest of app by waiting for the timer to indicate that full minute has passed?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem with getting QFuture and QFutureWatcher working properly

    Use QTimer.
    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.


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

    jahsiotr (14th January 2013)

  4. #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

    There is an additional problem in the original code: the future watcher object is created on the stack, so it is being deleted whenever that function's context ends.
    If I read this correctly this is code inside the main window's constructor, so the future watcher will be gone by the time the window shows up.

    Cheers,
    _

Similar Threads

  1. Replies: 1
    Last Post: 7th December 2011, 00:49
  2. QFutureWatcher finished() signal not working
    By DiamonDogX in forum Qt Programming
    Replies: 13
    Last Post: 25th October 2011, 18:27
  3. QFutureWatcher finished without even starting a QFuture...
    By Zweistein in forum Qt Programming
    Replies: 0
    Last Post: 22nd September 2011, 14:30
  4. memcpy not working properly
    By sattu in forum Qt Programming
    Replies: 3
    Last Post: 26th October 2010, 23:33
  5. ScrollZoomer not working properly..
    By Raghaw in forum Qwt
    Replies: 1
    Last Post: 30th October 2009, 06:51

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.