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. Changing QDial angle range, zero-point, and pointer image
Forum Updated to NodeBB v4.3 + New Features

Changing QDial angle range, zero-point, and pointer image

Scheduled Pinned Locked Moved Solved General and Desktop
qdial
4 Posts 2 Posters 475 Views 1 Watching
  • 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.
  • S Offline
    S Offline
    swurl
    wrote on 4 Nov 2023, 05:05 last edited by
    #1

    By default, it looks like the QDial has a ~270 degree range, with its zero-point at a roughly 225° angle, and a pointer image that is pretty much just a little circle (this part seems platform dependent?).

    All of these are things I'd like to change. My first intuition is to change paintEvent to change the range, zero-point, and the image (likely by drawing a custom pointer with QPainter), and perhaps also change mouseEvent to accommodate these changes.

    However, I'm not entirely sure how this would be done, as it would effectively mean completely redoing QDial's paint and mouse events that handle all the logic that results in the defaults mentioned above... any help?

    1 Reply Last reply
    0
    • S swurl
      5 Nov 2023, 20:44

      @SGaist Yeah, I've seen that many times... I'd like to remove external dependencies as much as possible outside of what's actually necessary.

      (It would also be a valuable learning experience to reimplement much of QDial to my needs.)

      S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 6 Nov 2023, 20:58 last edited by
      #4

      @swurl then the most simple is to read the code of QDial and create your own based on it.

      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
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 4 Nov 2023, 20:18 last edited by
        #2

        Hi,

        Before trying to rebuild QDial from scratch, did you check the Qwt librairie Dial components ?

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

        S 1 Reply Last reply 5 Nov 2023, 20:44
        0
        • S SGaist
          4 Nov 2023, 20:18

          Hi,

          Before trying to rebuild QDial from scratch, did you check the Qwt librairie Dial components ?

          S Offline
          S Offline
          swurl
          wrote on 5 Nov 2023, 20:44 last edited by
          #3

          @SGaist Yeah, I've seen that many times... I'd like to remove external dependencies as much as possible outside of what's actually necessary.

          (It would also be a valuable learning experience to reimplement much of QDial to my needs.)

          S 1 Reply Last reply 6 Nov 2023, 20:58
          0
          • S swurl
            5 Nov 2023, 20:44

            @SGaist Yeah, I've seen that many times... I'd like to remove external dependencies as much as possible outside of what's actually necessary.

            (It would also be a valuable learning experience to reimplement much of QDial to my needs.)

            S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 6 Nov 2023, 20:58 last edited by
            #4

            @swurl then the most simple is to read the code of QDial and create your own based on it.

            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
            • S swurl has marked this topic as solved on 4 Jan 2024, 21:55

            1/4

            4 Nov 2023, 05:05

            • Login

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