<?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[[Solved] QTableWidget - problem when editing multiple items]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">The QTableWidget is not notifying a change when an item is "changed" for the same value.<br />
It seems silly, but it's important when editing multiple items.</p>
<p dir="auto">This is my code:<br />
@<br />
QTableWidgetTest::QTableWidgetTest(QWidget <em>parent, Qt::WFlags flags)<br />
: QDialog(parent, flags)<br />
{<br />
ui.setupUi(this);<br />
//...<br />
connect(ui.tableWidget,  SIGNAL(itemChanged(QTableWidgetItem</em>)), this,  SLOT(multipleItemsChanged(QTableWidgetItem*)));<br />
}</p>
<p dir="auto">//...</p>
<p dir="auto">void QTableWidgetTest::multipleItemsChanged( QTableWidgetItem <em>item )<br />
{<br />
ui.tableWidget-&gt;blockSignals(true);<br />
QList&lt;QTableWidgetItem</em>&gt; selectedItems = ui.tableWidget-&gt;selectedItems();<br />
foreach(QTableWidgetItem* selectItem, selectedItems)<br />
{<br />
selectItem-&gt;setText(item-&gt;text());<br />
}<br />
ui.tableWidget-&gt;blockSignals(false);<br />
}<br />
@</p>
<p dir="auto">"Sample project":<a href="http://dl.dropbox.com/u/18906327/QTableWidgetTest.zip" target="_blank" rel="noopener noreferrer nofollow ugc">http://dl.dropbox.com/u/18906327/QTableWidgetTest.zip</a></p>
<p dir="auto">It's important to use the same value as the last item selected.<br />
If you test with only one item, the result is the same.</p>
<p dir="auto">Does somebody know another way to solve this?</p>
]]></description><link>https://forum.qt.io/topic/10543/solved-qtablewidget-problem-when-editing-multiple-items</link><generator>RSS for Node</generator><lastBuildDate>Tue, 11 Aug 2026 10:21:15 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/10543.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 18 Oct 2011 17:32:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [Solved] QTableWidget - problem when editing multiple items on Fri, 21 Oct 2011 09:46:50 GMT]]></title><description><![CDATA[<p dir="auto">The link below can help you:</p>
<p dir="auto"><a href="http://www.qtcentre.org/threads/45348-QTableWidget-problem-when-editing-multiple-items" target="_blank" rel="noopener noreferrer nofollow ugc">http://www.qtcentre.org/threads/45348-QTableWidget-problem-when-editing-multiple-items</a></p>
]]></description><link>https://forum.qt.io/post/114049</link><guid isPermaLink="true">https://forum.qt.io/post/114049</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 21 Oct 2011 09:46:50 GMT</pubDate></item></channel></rss>