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 emit signal about rowCountChanged
Forum Update on Monday, May 27th 2025

QAbstractItemModel how emit signal about rowCountChanged

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 238 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
    Mihaill
    wrote on last edited by
    #1

    Hi!
    How in QAbstractItemModel emit signal about rowCountChanged?
    Or how in QML TableView update rowCount?

    JonBJ 1 Reply Last reply
    0
    • M Mihaill

      Hi!
      How in QAbstractItemModel emit signal about rowCountChanged?
      Or how in QML TableView update rowCount?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @Mihaill said in QAbstractItemModel how emit signal about rowCountChanged:

      How in QAbstractItemModel emit signal about rowCountChanged?

      The row count changes when you either insert or remove a row (or reset/clear model). Signals come from the begin/endInsert/RemoveRows() implementations.

      rowsInserted/Removed() signals --- see e.g. https://forum.qt.io/topic/48950/solved-qtablewidget-signal-for-rowcountchanged-needed/2.

      M 1 Reply Last reply
      1
      • JonBJ JonB

        @Mihaill said in QAbstractItemModel how emit signal about rowCountChanged:

        How in QAbstractItemModel emit signal about rowCountChanged?

        The row count changes when you either insert or remove a row (or reset/clear model). Signals come from the begin/endInsert/RemoveRows() implementations.

        rowsInserted/Removed() signals --- see e.g. https://forum.qt.io/topic/48950/solved-qtablewidget-signal-for-rowcountchanged-needed/2.

        M Offline
        M Offline
        Mihaill
        wrote on last edited by
        #3

        @JonB Thanks
        It's work:

        void IndicationsModel::addUuid(const QUuid &uuid)
        {
            m_uuidsSensors.append(uuid);
            beginInsertRows(QModelIndex(), m_uuidsSensors.count() - 1, m_uuidsSensors.count() - 1);
            insertRow(m_uuidsSensors.count() - 1);
            endInsertRows();
        }
        
        1 Reply Last reply
        0
        • M Mihaill has marked this topic as solved on

        • Login

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