Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    QML crash QObjectWrapper::wrap / getProperty

    QML and Qt Quick
    binding qml crash getproperty wrap qtquick
    3
    4
    2232
    Loading More Posts
    • 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
      Pheelbert last edited by Pheelbert

      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!

      p3c0 1 Reply Last reply Reply Quote 0
      • p3c0
        p3c0 Moderators @Pheelbert last edited by

        @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 Reply Quote 1
        • C
          chrisadams last edited by

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

          P 1 Reply Last reply Reply Quote 1
          • P
            Pheelbert @chrisadams last edited by

            @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 Reply Quote 0
            • First post
              Last post