<?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[QTableWidget Read Cell Value]]></title><description><![CDATA[<p dir="auto">Hi, I try to make an desktop app that get some values from user and make some calculations and show result.<br />
I prepared my design from QtDesigner, convert design to code and all I want is just get the value from the table cell.</p>
<p dir="auto">Everywhere I research gives the code;</p>
<pre><code># Get the first column and first row of table
self.tableWidget.itemAt(0,0).text()
</code></pre>
<p dir="auto">Actually it works. I can get the value of first column and first row.</p>
<pre><code># Try to get all 6 cells values
self.tableWidget.itemAt(0,0).text()
self.tableWidget.itemAt(0,1).text()
self.tableWidget.itemAt(0,2).text()
self.tableWidget.itemAt(1,0).text()
self.tableWidget.itemAt(1,1).text()
self.tableWidget.itemAt(1,2).text()
</code></pre>
<p dir="auto">But when I try to get other 5 cells values, it returns <strong>same</strong> value.</p>
<p dir="auto">After some investigation, I found that that itemAt(x,y) values are not indexes. They are pixels.<br />
I try to figure out how it works heuristicly.</p>
<pre><code># this may gives second rows item
self.tableWidget.itemAt(20,40).text()
</code></pre>
<p dir="auto">Isn't there a way for access the cells other than this weird method?</p>
<p dir="auto">Actually I don't want to access the cells with pixels, I just want to access them via index.</p>
]]></description><link>https://forum.qt.io/topic/138438/qtablewidget-read-cell-value</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 20:11:51 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/138438.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 08 Aug 2022 02:25:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QTableWidget Read Cell Value on Mon, 08 Aug 2022 06:30:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/msalih">@<bdi>msalih</bdi></a><br />
<a href="https://doc.qt.io/qt-6/qtablewidget.html#item" target="_blank" rel="noopener noreferrer nofollow ugc">QTableWidgetItem *QTableWidget::item(int row, int column) const</a>.</p>
]]></description><link>https://forum.qt.io/post/724089</link><guid isPermaLink="true">https://forum.qt.io/post/724089</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Mon, 08 Aug 2022 06:30:44 GMT</pubDate></item></channel></rss>