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. How to process events during window drag/resize.

How to process events during window drag/resize.

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.5k 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.
  • K Offline
    K Offline
    Kwabena
    wrote on last edited by
    #1

    I have async-data being sent to my application that needs to be processed by the GUI thread. My problem is that when a window is dragged or re-sized in my application the GUI thread is blocked until the event is finished. Is there any way to change the behavior so events are processed during window drags and resizes?

    I want to multi-thread the part of my application that is handling this async-data, but part of handling the data requires me to create new GUI objects and such. I can't do this in another thread. Since the GUI thread can be blocked indefinitely by window drag or resize I'm out of luck with this approach. Even if I queue up things for the GUI thread to do while resizing/dragging occurs, I'm afraid this could crash my application if the data is never processed by the GUI thread in a timely fashion.

    Does anyone know how to solve a problem like this? Should I just assume that the user will never drag/resize the application indefinitely that would cause a crash, and then multi-thread everything?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      butterface
      wrote on last edited by
      #2

      That sounds like a bad design to me. Your UI should not depend on anything sent to you but your model should get updated. After your model is updated you can notify your UI that there is something new to display so this will never interfere with resizing or dragging because these events will occur one after the other.

      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