<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[signal rowsInserted in QAbstractTableModel]]></title><description><![CDATA[<p dir="auto">Hi!<br />
I use Qt 5.15.<br />
I use QAbstractTableModel  and i want set table aboute added row.<br />
I think that me need signam rowsInserted.<br />
<a href="https://doc.qt.io/qt-5/qabstractitemmodel.html#rowsInserted" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qabstractitemmodel.html#rowsInserted</a><br />
In documentatin that signal have 3 arguments, but QtCreater think that need 4 arguments, last argument - QPrivateSignal.<br />
Whot me need doing?<br />
<img src="https://ddgobkiprc33d.cloudfront.net/b1acb1ef-664a-4d92-b83c-0455761e0437.png" alt="285bb0ac-34b3-4333-8947-40ba8e6cced0-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.qt.io/topic/146019/signal-rowsinserted-in-qabstracttablemodel</link><generator>RSS for Node</generator><lastBuildDate>Mon, 02 Nov 2026 16:40:36 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/146019.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 26 Jun 2023 16:04:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to signal rowsInserted in QAbstractTableModel on Tue, 27 Jun 2023 08:04:28 GMT]]></title><description><![CDATA[<p dir="auto">it's work</p>
<pre><code>            int row = m_data.count();
//            if (m_data.count() == 0) {
//                row = 0;
//            }
            QModelIndex index = createIndex(row, 0);
//            beginInsertRows(index, row, row);
            beginInsertRows(QModelIndex(), row, row);
            addData(AlarmObject (item, isAlarm, QDateTime::currentDateTime(),
                                 m_client-&gt;getAlarmColorCategory(uuid)));
            endInsertRows();
</code></pre>
]]></description><link>https://forum.qt.io/post/762709</link><guid isPermaLink="true">https://forum.qt.io/post/762709</guid><dc:creator><![CDATA[Mihaill]]></dc:creator><pubDate>Tue, 27 Jun 2023 08:04:28 GMT</pubDate></item><item><title><![CDATA[Reply to signal rowsInserted in QAbstractTableModel on Tue, 27 Jun 2023 08:00:08 GMT]]></title><description><![CDATA[<p dir="auto">I try use this, but it's not work:</p>
<pre><code>            int row = m_data.count();
            QModelIndex index = createIndex(row, 0);
            beginInsertRows(index, row, row);
            addData(AlarmObject (item, isAlarm, QDateTime::currentDateTime(),
                                 m_client-&gt;getAlarmColorCategory(uuid)));
            endInsertRows();
</code></pre>
]]></description><link>https://forum.qt.io/post/762707</link><guid isPermaLink="true">https://forum.qt.io/post/762707</guid><dc:creator><![CDATA[Mihaill]]></dc:creator><pubDate>Tue, 27 Jun 2023 08:00:08 GMT</pubDate></item><item><title><![CDATA[Reply to signal rowsInserted in QAbstractTableModel on Tue, 27 Jun 2023 07:33:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a> I directly wrote a row to the data container, made beginInsertRows and endInsertRows, but the table is not updated.</p>
]]></description><link>https://forum.qt.io/post/762698</link><guid isPermaLink="true">https://forum.qt.io/post/762698</guid><dc:creator><![CDATA[Mihaill]]></dc:creator><pubDate>Tue, 27 Jun 2023 07:33:49 GMT</pubDate></item><item><title><![CDATA[Reply to signal rowsInserted in QAbstractTableModel on Tue, 27 Jun 2023 07:19:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mihaill">@<bdi>Mihaill</bdi></a> I guess: "Your job is to implement insertRows() and call beginInsertRows(). Read <a href="https://doc.qt.io/qt-5/qabstractitemmodel.html#subclassing" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qabstractitemmodel.html#subclassing</a> carefully." ?</p>
]]></description><link>https://forum.qt.io/post/762695</link><guid isPermaLink="true">https://forum.qt.io/post/762695</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Tue, 27 Jun 2023 07:19:32 GMT</pubDate></item><item><title><![CDATA[Reply to signal rowsInserted in QAbstractTableModel on Tue, 27 Jun 2023 07:18:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> but how I can set TableView that in model apeared new row?</p>
]]></description><link>https://forum.qt.io/post/762694</link><guid isPermaLink="true">https://forum.qt.io/post/762694</guid><dc:creator><![CDATA[Mihaill]]></dc:creator><pubDate>Tue, 27 Jun 2023 07:18:21 GMT</pubDate></item><item><title><![CDATA[Reply to signal rowsInserted in QAbstractTableModel on Mon, 26 Jun 2023 16:44:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mihaill">@<bdi>Mihaill</bdi></a><br />
As per the docs you cited, your code cannot <code>emit rowsInserted()</code>.  This is a signal Qt emits.  Your job is to implement <code>insertRows()</code> and call <code>beginInsertRows()</code>.  Read <a href="https://doc.qt.io/qt-5/qabstractitemmodel.html#subclassing" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qabstractitemmodel.html#subclassing</a> carefully.</p>
<p dir="auto">If you want to <code>connect()</code> to it that should be as per <a href="https://doc.qt.io/qt-5/qabstractitemmodel.html#rowsInserted" target="_blank" rel="noopener noreferrer nofollow ugc">void QAbstractItemModel::rowsInserted(const QModelIndex &amp;parent, int first, int last)</a>.  The <code>QPrivateSignal</code> one you showed is not for you.</p>
]]></description><link>https://forum.qt.io/post/762658</link><guid isPermaLink="true">https://forum.qt.io/post/762658</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Mon, 26 Jun 2023 16:44:26 GMT</pubDate></item></channel></rss>