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. Segmentation fault when using properties in QML
Forum Updated to NodeBB v4.3 + New Features

Segmentation fault when using properties in QML

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 721 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
    Slash200
    wrote on 29 Mar 2018, 13:33 last edited by
    #1

    Hello,

    I'm using properties in my QMLs, which uses items in this QML with parent.property. The properties are set by an JS, because I'm creating instances of this in runtime.
    In this example the property mainvalue is set by the JS. This code works well on windows, which is my platform where I develop. On my target platform, raspberry with rasbian, it causes a segmentation fault.

    property double mainvalue
    
            Gauge {
                id: vertgauge
                height: parent.height - 50
                width: parent.width * 0.1
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 10
                anchors.left: parent.left
                anchors.leftMargin: 10
                orientation: Qt.Vertical
                tickmarkStepSize : 0
                minorTickmarkCount: 0
                tickmarkAlignment: Qt.AlignRight
                value: parent.mainvalue
                //maximumValue: parent.maxvalue
    
                style: GaugeStyle {
                    valueBar: Rectangle {
                        implicitWidth: 25
                        color: "#9f9f9f"
                    }
                }
    
            }
    
    R 1 Reply Last reply 29 Mar 2018, 13:39
    0
    • S Slash200
      29 Mar 2018, 13:33

      Hello,

      I'm using properties in my QMLs, which uses items in this QML with parent.property. The properties are set by an JS, because I'm creating instances of this in runtime.
      In this example the property mainvalue is set by the JS. This code works well on windows, which is my platform where I develop. On my target platform, raspberry with rasbian, it causes a segmentation fault.

      property double mainvalue
      
              Gauge {
                  id: vertgauge
                  height: parent.height - 50
                  width: parent.width * 0.1
                  anchors.bottom: parent.bottom
                  anchors.bottomMargin: 10
                  anchors.left: parent.left
                  anchors.leftMargin: 10
                  orientation: Qt.Vertical
                  tickmarkStepSize : 0
                  minorTickmarkCount: 0
                  tickmarkAlignment: Qt.AlignRight
                  value: parent.mainvalue
                  //maximumValue: parent.maxvalue
      
                  style: GaugeStyle {
                      valueBar: Rectangle {
                          implicitWidth: 25
                          color: "#9f9f9f"
                      }
                  }
      
              }
      
      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 29 Mar 2018, 13:39 last edited by
      #2

      @Slash200
      how do you know that this assignment causes the crash?! Normally this just causes a runtime error, but no crash.
      Unless there is some custom type involved and it's property getter/setter has a bug in the C++ implementation.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      2

      1/2

      29 Mar 2018, 13:33

      • 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