Skip to content
QtWS25 Last Chance
  • 0 Votes
    4 Posts
    477 Views
    V
    No, it's not about a performance issue. I was just not satisfied with leaving this function running until the end, since I already had my result and the rest will not bring me anything more. If I need to write it in a simple 'foreach' loop, I would write something like for( value : list ) if( value == search ) return true; return false; And I wanted to keep the same spirit with 'mappedReduced' (as long as this doesn't violate any "thread-rules" and without having to "hack" QtConcurrent). But yes, in fact I'm blocking my application untile I receive the results. My other methods that need to perform an action on all the items use 'blockingMapped', 'blockingMappedReduced' and 'blockingFiltered'. It's for a library that I am writing. And the applications that will use it are procedurale, not a GUI (or, maybe later...who knows?). But they may have to handle very long lists, and the 'compute' function are heavy. So QtConcurrent is a welcome help. I think I'll keep the first solution, the most elegant one in my eyes, if I don't get any warning.