Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. TreeViewModel Clear and new Model
Qt 6.11 is out! See what's new in the release blog

TreeViewModel Clear and new Model

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 551 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.
  • Q Offline
    Q Offline
    Qt.Jo.Ha
    wrote on last edited by
    #1

    How do I clear the information in the TreeView Model and create and insert a new model?

    The reason I want to do this is because of Crash.

    Crash occurs after paintSiblingsRecursive is called recursively ..

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Why not fix the crash instead?

      Anyway. To replace a model, simply do this:

      model = someOtherModel
      

      in JS when you want the model to be replaced. Or, if you are using C++ model, you can call beginResetModel(), clear all data, then endResetModel().

      (Z(:^

      1 Reply Last reply
      3

      • Login

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