Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] QtConcurrent::run() and QWaitCondition destroyed messages
Forum Updated to NodeBB v4.3 + New Features

[Solved] QtConcurrent::run() and QWaitCondition destroyed messages

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    eker676
    wrote on last edited by
    #1

    Edit: I didn't have a QCoreApplication defined in main(). Added that, no more thread messages.

    I'm trying to run a function of a class using the QtConcurrent::run() method. The thread runs and does exactly what it should. However, when the thread ends, I get this error message in the console:
    @QWaitCondition: Destroyed while threads are still waiting@

    What's the correct way to use QtConcurrent::run() so that no unsightly error messages pop up?

    Here is the code in question (getPercentComplete() doesn't modify any data):
    @ bool (FileCopier::*async_copy)(void);
    async_copy = &FileCopier::copy;
    QFuture<bool> thread = QtConcurrent::run(&fc, async_copy);

    while(thread.isRunning())
    {
        cout << fc.getPercentComplete() << endl;
    }
    
    if(!thread.result())
        cout << "copy failed" << endl;@
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved