Glitch when disabling a dial widget
-
Hi everybody,
it's been a while that i am facing a glitch with the dial widget. This is the scenario:- my GUI starts, the dial button is enabled and it has a default value, -50
- I play with the dial, i can spin it and select a value, let's say -75
- An event from another button is triggered, this disables the dial widget
- Disabling the widget leads to have, in the background i suppose, the default value restored while the value set while using the dial is still there
This picture will make it even easier to understand.
Doing something like moving the cursor in order to overlap the default value is not an option. I mean something like
self.myDial.setSliderPosition(defaultValue=-50)
I would like to disable the dial and keep the last value inserted (-75) making disappearing the default value (-50).
Thanks in advance to all of you who will help me with this!
-
Hi and welcome to devnet,
Which version of PySide/PyQt ?
How did you install it ?
Can you provide a minimal runnable script that shows this behaviour ? -
Dear SGaist, thanks a lot for your reply.
I am currently using this set of libraries
PyQt5 5.15.4
PyQt5-Qt5 5.15.2
PyQt5-sip 12.8.1
PyQt5-stubs 5.15.2.0
PyQtWebEngine 5.15.4
PyQtWebEngine-Qt5 5.15.2I did install it with the usual pip install PyQt5.
I have extrapolated the code which cause the problem in a test project, just to share. In that case, with the very same dial object, i can not reproduce the issue. Unfortunately I can not share the original code... I am guessing if it makes sense sharing the demo code if it is working :-).
One thing i have noticed. In the test project, when i disable the dial widget, it changes color and becomes disabled. In my project, when i disable the dial widget, it doesnt change the color but i can not modifiy the position of the cursors manually either. -
Are you using some custom style in your application ?
-
Hi, thanks for the reply!
If you are asking if i have changed the StyleSheet of the object my answer is no, it is a classic dial with nothing else.
The only thing is that I have wrapped that object with others (radio buttons, text browser plus some spins) within a frame. I thought that this may have been the problem so I made the following attempts:- Removed the frame drastically and keep all the widgets
- Removed the dial from the frame in the code and put in it graphically
- Removed the dial from the frame in the code and graphically
Nothing fixed the problem. Everything was still there.
-
Then the next thing to do is to rebuild the widget one item after the other until it breaks.
-
Dear Gaist, thanks a lot for your help.
In the end, I have found a solution not knowing the reason of the bug yet.
After disabling the dial I set the methodsetAutoFillBackground(True)
this is basically doing what I need. No cursor popping up in the background, the dial turns blue which basically replicate exactly the behavior of the dial widget in my test project when disabling it.
I hope this post could help somebody else in the future.
Thanks for the support. -
Intriguing... Glad you could find a solution and thanks for sharing !
Since you have it working now, please mark the thread as solved using the "Topic Tools" button or the three dotted menu beside the answer that you deem correct so that other forum users may know a solution has been found :-)