Is it slow to constantly change the number of items in a QCombobox ?
-
I have a step-based application that reads data and displays it depending on certain buttons and combo boxes and other GUI stuff.
One of the important aspects is how fast the data can be read and visualized. It is meant to be viewed in real-time or even faster, at least in a very continuous way, no with a long pause in between steps. Of course it is always possible to pause to zoom in and stuff, but it is the live view when playing through the data which is important. A confortable playing speed is at 25 steps per second, up to 75 is still confortable (after that it becomes too fast for proper viewing).
The catch is the following : strictly speaking, I need to adapt the buttons and combo box items to the specific data of every step. Is this very slow to do, in general ?
I can instead have the combo boxes always have the max number of items, and some will just display nothing if chosen at some steps. Same for buttons : they can all be enabled all the time, and some will just do nothing when clicked at some steps. Would this be a lot faster when playing ?
I am talking about ~10 buttons and ~5 combo boxes with ~10 items each.
-
@SuperSelrak Do you mean you want to update content of buttons and combo boxes at 25-75Hz?! Not sure what the use case is to do something like this - isn't it very irritating for the user if the content of a combo box is constantly changing?
-
The buttons are not used when playing. Only when paused. Most of them would not visibly flicker, though some may.
-
@SuperSelrak said in Is it slow to constantly change the number of items in a QCombobox ?:
Is this very slow to do, in general ?
Would this be a lot faster when playing ?You tell us.
If the answer is yes, you'll have to add some additional logic to debounce or throttle the values for the combobox. If it's no you can use a naive implementation without additional work.So the best way of action seems to be try the easy way first, figure out if it is okay or too slow and adapt it only if necessary.
You could use tools like Hotspot if under Linux (similar tools exist on mac or windows) to help you analyze the performance of your app.
-
The buttons are not used when playing. Only when paused.
So update them once only when playing is paused.