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. Glitch when disabling a dial widget
QtWS25 Last Chance

Glitch when disabling a dial widget

Scheduled Pinned Locked Moved Unsolved Qt for Python
8 Posts 2 Posters 607 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.
  • G Offline
    G Offline
    ggbt
    wrote on last edited by ggbt
    #1

    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.

    8a34a80f-c4ad-4005-b7e9-e87bcc0b20c6-image.png

    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!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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 ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • G Offline
        G Offline
        ggbt
        wrote on last edited by
        #3

        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.2

        I 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.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Are you using some custom style in your application ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • G Offline
            G Offline
            ggbt
            wrote on last edited by
            #5

            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.
            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Then the next thing to do is to rebuild the widget one item after the other until it breaks.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • G Offline
                G Offline
                ggbt
                wrote on last edited by
                #7

                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 method

                setAutoFillBackground(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.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  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 :-)

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  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