Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QDial doesn't stop at end point issue
Forum Updated to NodeBB v4.3 + New Features

QDial doesn't stop at end point issue

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 5 Posters 510 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.
  • Dharani PrasadD Offline
    Dharani PrasadD Offline
    Dharani Prasad
    wrote on last edited by
    #1

    Hi all, I have added Qdial in my Qt Application. I am trying to set a start and end point to the Dial pointer. Dial pointer could be moved from start point to end point directly and vice versa, which shouldn't happen. Is there any way to stop the pointer at the end point and prevent it from moving to start point directly while trying

    Thanks in advance : )

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by ChrisW67
      #2

      @Dharani-Prasad Do you mean that the user can drag the dial handle from start to finish (e.g. 0 to 100 without going through 50) or that something the program does causes this to happen?

      Dharani PrasadD 1 Reply Last reply
      1
      • C ChrisW67

        @Dharani-Prasad Do you mean that the user can drag the dial handle from start to finish (e.g. 0 to 100 without going through 50) or that something the program does causes this to happen?

        Dharani PrasadD Offline
        Dharani PrasadD Offline
        Dharani Prasad
        wrote on last edited by
        #3

        @ChrisW67 said in QDial doesn't stop at end point issue:

        user can drag the dial handle from start to finish (e.g. 0 to 100 without going through 50) and (100 to 0 without going back through 50)

        This shouldn't happen.

        J.HilkJ 1 Reply Last reply
        0
        • Dharani PrasadD Dharani Prasad

          @ChrisW67 said in QDial doesn't stop at end point issue:

          user can drag the dial handle from start to finish (e.g. 0 to 100 without going through 50) and (100 to 0 without going back through 50)

          This shouldn't happen.

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @Dharani-Prasad have you changed the wrapping property of your dial from the default false?

          And it's still not clear what the unwanted behaviour is, can you show some code / gif?


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          1 Reply Last reply
          3
          • C Offline
            C Offline
            ChrisW67
            wrote on last edited by
            #5

            What you are describing is the documented behaviour of the QDial. When the user drags the slider out of range it snaps the the nearest end point. You would not like it to happen...not quite the same thing as it shouldn't happen.

            There is no simple way to change that behaviour. You could try experimenting with sliderMOved() signals in a slot that tracks the previous value and disallows max->min or min->max transitions. This will be difficult to get just right.

            1 Reply Last reply
            3
            • E Offline
              E Offline
              Eric Singer
              wrote on last edited by
              #6

              Respectfully agreeing with @Dharani-Prasad , this shouldn't happen because it is not the expected behavior of a UI dial control in any other context (just as you can't turn a physical knob from min directly to max in the CCW direction and vice-versa). This should be corrected in a future release, at least by option.

              Meanwhile, has anyone found a hack to prevent this? I tried putting < min and > max zones at the ends, resetting the value back to min/max if the user ventured into the zone, but this didn't work. Looking for other ideas.

              1 Reply Last reply
              0
              • Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @Eric-Singer said in QDial doesn't stop at end point issue:

                This should be corrected in a future release, at least by option.

                I don't have this problem but also don't have https://doc.qt.io/qt-5/qdial.html#wrapping-prop set to true. Please provide a minimal, compilable example where you can show your issue.

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                1 Reply Last reply
                1

                • Login

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