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. [SOLVED] beginInsertRows inside insertRow method?

[SOLVED] beginInsertRows inside insertRow method?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.5k 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.
  • M Offline
    M Offline
    Magnum
    wrote on 20 Jun 2013, 02:00 last edited by
    #1

    Hello,

    Is it necessary to call beginInsertRows method when implementing this method???

    @QAbstractItemModel::insertRow( int row, const QModelIndex & parent = QModelIndex() )@

    If it's not the case, why is it necessary for this one???
    @QAbstractItemModel::insertRows( int row, int count, const QModelIndex & parent = QModelIndex() )@

    Regards.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on 20 Jun 2013, 03:46 last edited by
      #2

      Function insertRow() is not virtual and not designed to reimplemented. The insertRow() function is implemented in terms of the virtual insertRows(). Get insertRows() right in your subclass and insertRow() follows automatically.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Magnum
        wrote on 28 Jun 2013, 18:59 last edited by
        #3

        Thanks, I didn't realize that It wasn't a virtual method.

        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