Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. PyQt6 - Refresh a lot of widget without freezing the GUI
Qt 6.11 is out! See what's new in the release blog

PyQt6 - Refresh a lot of widget without freezing the GUI

Scheduled Pinned Locked Moved Solved Qt for Python
2 Posts 1 Posters 1.3k 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.
  • bashtianB Offline
    bashtianB Offline
    bashtian
    wrote on last edited by
    #1

    Hello, I am at it again! :)
    I am looking for some advices to imprice my UI speed.

    I have a QScrollAera that can have a certain amount of widget in it, the size is arguable, around 20 to 50, but these widgets are made of many other widgets, which at the end takes a lot of time and resource to redraw, and freeze the UI.

    The idea is, that I have a setting to, for example, set the border color of the widgets, so when user changes that setting, the app has to redraw all the widgets which take some time - not very user friendly. The redraw is a simple: delete all item in the QSCrollArea container, and redraw all the widget one by one from my model which hold the list of widget to redraw.

    I tried with QRunnable - but UI item are not trade safe and one cannot simple pass parent from another thread. I also tried with some async methods, but I am pretty bad at it, so I am not why it did not work, either it cannot work either or I just configured it wrong.

    Any idea ? :)

    bashtianB 1 Reply Last reply
    0
    • bashtianB bashtian

      Hello, I am at it again! :)
      I am looking for some advices to imprice my UI speed.

      I have a QScrollAera that can have a certain amount of widget in it, the size is arguable, around 20 to 50, but these widgets are made of many other widgets, which at the end takes a lot of time and resource to redraw, and freeze the UI.

      The idea is, that I have a setting to, for example, set the border color of the widgets, so when user changes that setting, the app has to redraw all the widgets which take some time - not very user friendly. The redraw is a simple: delete all item in the QSCrollArea container, and redraw all the widget one by one from my model which hold the list of widget to redraw.

      I tried with QRunnable - but UI item are not trade safe and one cannot simple pass parent from another thread. I also tried with some async methods, but I am pretty bad at it, so I am not why it did not work, either it cannot work either or I just configured it wrong.

      Any idea ? :)

      bashtianB Offline
      bashtianB Offline
      bashtian
      wrote on last edited by
      #2

      @bashtian I believe I solved my problem. I don't need to delete and redraw them. instead of having just one signal to redraw, I am adding a setting_name param to the signal and just connect the widget part to it, listening to the setting that affect one or the other. It is fast and doesnt freeze the UI that much, sometime when there is a lot of widget to hide or show entirely it can be long, but otherwise its totaly acceptable!

      1 Reply Last reply
      0
      • bashtianB bashtian has marked this topic as solved on

      • Login

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