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. Question regarding background threads to process a QImage
QtWS25 Last Chance

Question regarding background threads to process a QImage

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 516 Views
  • 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.
  • P Offline
    P Offline
    PPNN
    wrote on last edited by
    #1

    I'd appreciate your advice re the design of an application part that requires the repeated processing of a large QImage depending on some GUI elements. The idea is that the resulting QImage "tracks" settings made by the user (input data is from another QImage).

    My original idea was to have a number of worker threads spawned to process groups of scanlines of the QImage. In case the user re-adjusts the GUI settings, the execution of these threads would be stopped, and new threads started based on the new GUI settings. Once all threads complete (without being interrupted by the user changing the settings further), the QImage would then be copied to a QPixmap that is part of a QGraphicsScene.

    My questions now are:

    1. I read that QObjects are not thread-safe. Does that mean that I cannot have several parallel threads work on sections (scanlines) of a QImage? Would there also be a conflict between the main GUI thread (where this QImage was created) and the worker threads? If yes, is there a way to solve this without copying large chunks of data to the threads and then back again?

    2. What would the best way be to wait for the successful completion of these worker threads without introducing a blocking condition in the main applications event loop?

    Thanks for your advice

    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