Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to implement a "speedometer" item?
QtWS25 Last Chance

How to implement a "speedometer" item?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 2 Posters 3.7k 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.
  • V Offline
    V Offline
    vishalreddy
    wrote on last edited by A Former User
    #1

    Hi all,
    This is vishal. I am newbie to this QT quick and QML. I am trying to develop a project using QT quick and QML. I am trying to develop a speedometer in which there are two text label, one is for maximum and the other is for minimum. If we give the maximum value the speedometer has to take that value. For example if we give the minimum value as 0 and max as 200 the speedometer has to show the values from 0 to 200 or if i give them from 0 to 100 the speedometer has to show the values from 0 to 100. I dont want the analog in the speedometer to move i just want the values to be changed. The other thing is can we create a speedometer image and add the values or else do we have to only take the static image of speedometer and add to them?

    So,guys please help me out to solve the above problem.

    Thanks,
    Vishal.

    [Edit: Changed title -- @Wieland]

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi! Please give your thread a meaningful title. Also see Hitchhiker's Visual Guide to the Qt Forum and Forum general guide.

      There is already a "speedometer", see CircularGauge QML Type. You can customize its appearance with CircularGaugeStyle QML Type.

      1 Reply Last reply
      2
      • V Offline
        V Offline
        vishalreddy
        wrote on last edited by
        #3

        HI,
        Thanks for the reply. I know that there is a speedometer in the qt documentation. But what i want is entirely different. I want to change the values in the speedometer. I don't want the needle to move but i just want the values in the speedometer to change. I want the following to create the speedometer
        -> I need to create a speedometer using the QT quick widgets. I don't want to add a static image to the qt.
        -> once i created the speedometer, i want to change the min and max values on the speedometer i.e., if i give the min values as 0 and give the max value as 100 the speedometer has to change the values from 0 to 100. See here i don't want the needle in the speedmoter to move i just want values to be changed. If i give min values as 0 and max 270 the values on the speedometer has to change accordingly to the given min and max values.

        Hope you understand the problem and will give some inputs to the above problem.

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by A Former User
          #4

          I don't see how what you want is any different from what CircularGauge provides: It has maximumValue, minimumValue, stepSize. These values aren't fixed, but can be changed during the lifetime of the component as frequent as you wish. And the background can be made of arbitrary visual components; no need to add an image.

          Anyway, if you want to build a new component from scratch, you can either write it entirely in QML, or write a Quick item in C++, by deriving from QQuickPaintedItem.

          1 Reply Last reply
          3
          • V Offline
            V Offline
            vishalreddy
            wrote on last edited by
            #5

            Hi,
            thanks for your response .my project is to develop a tool of speed gauge and i have to drag those tool and then i have to give the values of min and max ,if i change the values of speedometer needle should not movie all i need is the value should change accordingly,for example min value as 0 max value is 100 if i change the min value to 10 the min value should be changed accordingly remaining values should also change from min to max.all values in the speedometer must change accordingly.

            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