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. QML crash QObjectWrapper::wrap / getProperty
QtWS25 Last Chance

QML crash QObjectWrapper::wrap / getProperty

Scheduled Pinned Locked Moved QML and Qt Quick
bindingqmlcrashgetpropertywrapqtquick
4 Posts 3 Posters 2.8k 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.
  • P Offline
    P Offline
    Pheelbert
    wrote on 21 Aug 2015, 22:26 last edited by Pheelbert
    #1

    This is the stack trace: http://pastebin.com/6wuUh12x

    It doesn't really help me other than tell me that it might have to do with property bindings; I don't think that posting the code will help since it's not that simple and wouldn't want to flood you guys with code!

    Where have you seen this kind of error before? Thanks for the help!

    EDIT: I found out that it crashes in this timer I have

    Timer {
        running: true; interval: 100; repeat: true;
        onTriggered: {
            if (delegateState && delegateState.machine && stateListModel) {
                if (!delegateState.machine.state) {
                    stateListModel.setProperty(index, "delegateIsMachineCurrentState", false);
                } else {
                    stateListModel.setProperty(index, "delegateIsMachineCurrentState", (delegateState.name === delegateState.machine.state.name) ? true : false);
                    if (delegateIsMachineCurrentState) stateListModel.setProperty(index, "delegateIsCurrentStatePlaying", delegateState.machine.currentStatePlaying());
                }
                if (!delegateIsMachineCurrentState) stateListModel.setProperty(index, "delegateIsCurrentStatePlaying", false);
            }
        }
    }
    

    EDIT 2: I just found out that it crashes when I call delegateState.machine, which is a q_property that returns a pointer (constant, no notify)... I find it strange since I check just want to check if it's null or not!

    P 1 Reply Last reply 23 Aug 2015, 05:52
    0
    • P Pheelbert
      21 Aug 2015, 22:26

      This is the stack trace: http://pastebin.com/6wuUh12x

      It doesn't really help me other than tell me that it might have to do with property bindings; I don't think that posting the code will help since it's not that simple and wouldn't want to flood you guys with code!

      Where have you seen this kind of error before? Thanks for the help!

      EDIT: I found out that it crashes in this timer I have

      Timer {
          running: true; interval: 100; repeat: true;
          onTriggered: {
              if (delegateState && delegateState.machine && stateListModel) {
                  if (!delegateState.machine.state) {
                      stateListModel.setProperty(index, "delegateIsMachineCurrentState", false);
                  } else {
                      stateListModel.setProperty(index, "delegateIsMachineCurrentState", (delegateState.name === delegateState.machine.state.name) ? true : false);
                      if (delegateIsMachineCurrentState) stateListModel.setProperty(index, "delegateIsCurrentStatePlaying", delegateState.machine.currentStatePlaying());
                  }
                  if (!delegateIsMachineCurrentState) stateListModel.setProperty(index, "delegateIsCurrentStatePlaying", false);
              }
          }
      }
      

      EDIT 2: I just found out that it crashes when I call delegateState.machine, which is a q_property that returns a pointer (constant, no notify)... I find it strange since I check just want to check if it's null or not!

      P Offline
      P Offline
      p3c0
      Moderators
      wrote on 23 Aug 2015, 05:52 last edited by
      #2

      @Pheelbert Have you registered the machine class ? Ofcourse if it weren't console would have showed the error. AFAIK checking null in that way should work.

      157

      1 Reply Last reply
      1
      • C Offline
        C Offline
        chrisadams
        wrote on 24 Aug 2015, 07:25 last edited by
        #3

        Are you certain that you're not running into https://bugreports.qt.io/browse/QTBUG-40448 by any chance?

        P 1 Reply Last reply 1 Sept 2015, 17:33
        1
        • C chrisadams
          24 Aug 2015, 07:25

          Are you certain that you're not running into https://bugreports.qt.io/browse/QTBUG-40448 by any chance?

          P Offline
          P Offline
          Pheelbert
          wrote on 1 Sept 2015, 17:33 last edited by
          #4

          @chrisadams I think so, I ended up reacting to a signal (from the collection of 'machines') instead of using a timer and I don't have an issue anymore!

          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