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. accu gauge
Forum Updated to NodeBB v4.3 + New Features

accu gauge

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 162 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.
  • S Offline
    S Offline
    Sharkii
    wrote on last edited by
    #1

    Hi

    i want design a simple horizontal accu gauge.
    Range 10 to 14 V , three colors red, yellow, green in state of voltage.
    My problem begin at the range. The tickmarks will not displayed.

    Rectangle {
            x : 120
            y : 200
            width: 200
            height: 50
            color: "#494d53"
    
            Gauge {
                id: accu
                anchors.fill: parent
                anchors.margins: 4
                orientation : Qt.Horizontal
                tickmarkStepSize : 5
                tickmarkAlignment: QT.AlignBottom
                minimumValue: 10
                maximumValue: 14
                value: 12
    
                style: GaugeStyle {
                    valueBar: Rectangle {
                        implicitWidth: 10
                        color: "red"
    
                    }
                }
            }
        }
    
    1 Reply Last reply
    0
    • S Offline
      S Offline
      Sharkii
      wrote on last edited by
      #2

      Solved :-)

      the problem was the tickmarkStepSize : 4

      Rectangle {
              x : 70
              y : 400
              width: 200
              height: 50
              color: "#808080"
      
              Gauge {
                  id: accu
                  anchors.fill: parent
                  anchors.margins: 10
                  orientation : Qt.Horizontal
                  tickmarkStepSize : 0.5
                  tickmarkAlignment: Qt.AlignBottom
                  minimumValue: 11
                  maximumValue: 13
                  value: 12.6
      
                  style: GaugeStyle {
                      valueBar: Rectangle {
                          implicitWidth: 10
                          color: (accu.value <= 12) ? "red" : (accu.value <= 12.5) ? "yellow" : "green"
                      }
                  }
              }
          }
      
      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