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. Changing view's model crashes at some point
Forum Updated to NodeBB v4.3 + New Features

Changing view's model crashes at some point

Scheduled Pinned Locked Moved QML and Qt Quick
bugtreeviewlistviewcrash
2 Posts 1 Posters 1.1k 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.
  • P Offline
    P Offline
    Pheelbert
    wrote on last edited by
    #1

    Lets say I have a bunch of tabs and on tab index changed I change the model of a TreeView for the corresponding on in a map I have made in C++.

    What I have described works great, the issue is that after a little time switching around the tabs it crashes with this error: http://pastebin.com/m7j3b8NG

    Thank you for your help.

    P 1 Reply Last reply
    0
    • P Pheelbert

      Lets say I have a bunch of tabs and on tab index changed I change the model of a TreeView for the corresponding on in a map I have made in C++.

      What I have described works great, the issue is that after a little time switching around the tabs it crashes with this error: http://pastebin.com/m7j3b8NG

      Thank you for your help.

      P Offline
      P Offline
      Pheelbert
      wrote on last edited by
      #2

      Nevermind I found a solution:

      QQmlApplicationEngine::setObjectOwnership(MY_OBJECT*, QQmlApplicationEngine::CppOwnership);
      

      It's important to set this whenever returning a pointer in a Q_INVOKABLE function or else it might get garbage collected apparently.

      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