fix: fix a number of issues with Labeled and Range Sliders, add LabelsOnHandle mode. #242
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a variety of issues I've encountered, mostly with labeled sliders:
QApplication.processEvents()
in the labeled sliders. When using this slider in one of my applications, I was observing some very strange behavior. Gradually, by removing things piece by piece, I was able to narrow it down to these calls toprocessEvents()
in the slider. The calls are there because, without them, if you interactively do something like.setEdgeLabelMode(wdg.EdgeLabelMode.NoLabel)
, it will leave the handle labels in a slightly odd position, until the next time the widget is updated (which is likely to be very soon, or at least the next time the slider is touched/moved). I will try to figure out how to fix that moment of unstyled view, but the consequences of callingprocessEvents
are probably even worse, and much harder to debug (since it can have a global effect, but no one would know where it's coming from).LabelPosition.LabelsOnHandle
enum that results in the labels being placed directly ON a slider handle. It's not always useful, but it can save space if you're also using a custom stylesheet.ensure_main_thread