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. QAbstractItemModel: How to signal major change?

QAbstractItemModel: How to signal major change?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 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.
  • N Offline
    N Offline
    nonot1
    wrote on last edited by
    #1

    Hello,

    If I've got a QAbstractItemModel based hierarchal model, and I need to make significant changes to it's structure at run time, what functions do I need to call to alert the view before and after the change?

    (Rows would need to be added, removed, and relocated at the same time. Columns would not change.)

    Since, I don't see any generic beginModelReorganization() and endModelReorganization() calls, what is the correct procedure?

    Is it just beginResetModel()/endResetModel() to completely clear any viewer state?

    Thank you

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      You should call "QAbstractItemModel::beginResetModel() ":http://doc.qt.nokia.com/4.7/qabstractitemmodel.html#beginResetModel and "QAbstractItemModel::endResetModel() ":http://doc.qt.nokia.com/4.7/qabstractitemmodel.html#endResetModel

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • N Offline
        N Offline
        nonot1
        wrote on last edited by
        #3

        Thank you, Volker.

        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