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. What happens between beginMoveRows() and endMoveRows() in QAbstractItemModel
Qt 6.11 is out! See what's new in the release blog

What happens between beginMoveRows() and endMoveRows() in QAbstractItemModel

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.4k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I have custom model for table view.

    To change rows in the model i use beginMoveRows() and endMoveRows().

    In docs I don't found the answer about what this methods do with model: are they moves indexes or just serves to emit signal(s) about rows moved rowsMoved()

    So I need to know should I change my data directly or need to use beginMoveRows() and endMoveRows() for this purpose.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi,

      According to the documentation and the source code, these methods will change the persistent indexes of your model (not really sure about what is a persistent index, if someone has some tips...) and, you're right, will emit the corresponding signals. If it is your question, it won't do anything on the underlying data : it's up to you to modify them (and keep the model aware e.g. by using beginMoveRows() and endMoveRows(), so it could inform the connected views).

      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