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. Does reparented widgets get drawn when parent is redrawn?
Forum Updated to NodeBB v4.3 + New Features

Does reparented widgets get drawn when parent is redrawn?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 618 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.
  • Z Offline
    Z Offline
    zerog80
    wrote on last edited by
    #1

    Hi to everybody! :)

    I have the following situation: a Manager [QMainWindow] has a Tracker [QWidget] as its centralWidget and it has a layout with several Camera [QWidget and QRunnable] implementing the virtual methods run() and paintEvent().

    The execution should be as follows:

    Manager launches a long-running thread [QtConcurrent::run()] to continuosly update each Camera inside the Tracker

    In each step of this thread, Tracker launches a thread for each Camera [QThreadPool::start()] that prepares the QImage to be shown by every Camera

    Every Camera widget inside Tracker should be updated with the new image previously computed

    Tracker waits for every Camera thread to be finished [QThreadPool::waitForDone()] then restart the update loop

    At every time, Manager should be able to interrupt and resume the Tracker process

    So... my questions about this scenario are the following ones:

    • Calling update() on Tracker gets every Camera's update() method called?
    • Tracker has a QHash containing all the Cameras, but once the Camera* are added to its layout, accessing to QHash.value() methods causes the related widgets to be updated too?
    • Qt (correctly) argues that Camera's paintEvent() are not called by the GUI thread but I could not find a better solution for not blocking the QMainWindow event loop... is there anyone that has a better idea for constructing a better multithreaded scenario for this setup?

    Thanks in advance for any kind answer or suggestion about this! :)

    -=[ Zero_G ]=-

    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