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. Gauge QML and tickmark direction?
Forum Updated to NodeBB v4.3 + New Features

Gauge QML and tickmark direction?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
gauge qml
2 Posts 2 Posters 1.4k 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
    SteinarK
    wrote on 24 Jan 2016, 16:02 last edited by SteinarK
    #1

    In my attempt to learn Qt and QML: Is there a possibility to instruct the Gauge in QML to display the tickmark from right to left when the orientation is horizontal? I.e. from 0 1 2 3 ... to ... 3 2 1 0

    My current code is:

                Gauge {
                    id: gaugeBdFR
                    minimumValue: 0
                    value: tBdFR
                    width: parent.width*0.4
                    maximumValue: 40
                    minorTickmarkCount: 5
                    tickmarkStepSize : 5
                    orientation: Qt.Horizontal
    
                    formatValue: function(value) {
                        return value.toFixed(0);
                    }
    
                    style: GaugeStyle {
                        valueBar: Rectangle {
                            implicitWidth: 38
                            color: Qt.rgba(gaugeBdFR.value / gaugeBdFR.maximumValue, 1- gaugeBdFR.value /(gaugeBdFR.maximumValue+1), 0, 1)
                        }
    
                        minorTickmark: Item {
                            implicitWidth: 8
                            implicitHeight: 1
    
                            Rectangle {
                                color: "#cccccc"
                                anchors.fill: parent
                                anchors.leftMargin: 2
                                anchors.rightMargin: 4
                            }
                        }
                    }
                } 
    
    
    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on 24 Jan 2016, 18:09 last edited by
      #2

      Hi! Do you mean like this?

      gauge

      1 Reply Last reply
      0

      1/2

      24 Jan 2016, 16:02

      • Login

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