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 Update on Monday, May 27th 2025

Segmentation fault when using properties in QML

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 696 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
    Slash200
    wrote on 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"
                    }
                }
    
            }
    
    raven-worxR 1 Reply Last reply
    0
    • S Slash200

      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"
                      }
                  }
      
              }
      
      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on 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

      • Login

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