<?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[Displaying my data to QTableWidget]]></title><description><![CDATA[<p dir="auto">I have created a table widget with headers RYOTNUMBER ,PLOTNUMBER and CUTTINGORDERCODE , well my code is</p>
<pre><code>sn "1"
SEASONCODE "1920"
RYOTNUMBER "INKA010601001004"
VILLAGECODE "INKA010601001"
OFFICERCODE "MD001 "
DATE "2019-01-30"
TIME "14:50"
OFFICERNAME "Y T VODDAGALLAIA"
PLOTNUMBER "123"
CUTTINGORDERCODE "0051"
GANGLEADERCODE "GNL0001"
MODEOFTRANSPORT "Own"
CROPTYPE "HSV"
COB "2019-06-17"

sn "2"
SEASONCODE "1920"
RYOTNUMBER "INKA010601001004"
VILLAGECODE "INKA010601001"
OFFICERCODE "MD001 "
DATE "2019-01-30"
TIME "17:30"
OFFICERNAME "Y T VODDAGALLAIA"
PLOTNUMBER "421"
CUTTINGORDERCODE "009"
GANGLEADERCODE "GNL0001"
MODEOFTRANSPORT "Company"
CROPTYPE "HSV"
COB "2019-03-9"
</code></pre>
<p dir="auto">where it keeps on going so now my question is I need these RYOTNUMBER ,PLOTNUMBER and CUTTINGORDERCODE three values to be entered in my table. Any help?</p>
<p dir="auto">Thanks and regards.</p>
]]></description><link>https://forum.qt.io/topic/99143/displaying-my-data-to-qtablewidget</link><generator>RSS for Node</generator><lastBuildDate>Thu, 05 Nov 2026 03:35:31 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/99143.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 30 Jan 2019 12:19:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Displaying my data to QTableWidget on Thu, 31 Jan 2019 08:21:14 GMT]]></title><description><![CDATA[<p dir="auto">If you don't need editing then you can use <code>QSqlQueryModel</code> and directly select only the columns you need in the select statement</p>
]]></description><link>https://forum.qt.io/post/508549</link><guid isPermaLink="true">https://forum.qt.io/post/508549</guid><dc:creator><![CDATA[VRonin]]></dc:creator><pubDate>Thu, 31 Jan 2019 08:21:14 GMT</pubDate></item><item><title><![CDATA[Reply to Displaying my data to QTableWidget on Thu, 31 Jan 2019 06:02:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vronin">@<bdi>VRonin</bdi></a> well I've added this line</p>
<pre><code>ui-&gt;tableView-&gt;hideColumn(1);
</code></pre>
<p dir="auto">to hide the columns which i didn't need of. Thanks  by the way for your response.</p>
]]></description><link>https://forum.qt.io/post/508504</link><guid isPermaLink="true">https://forum.qt.io/post/508504</guid><dc:creator><![CDATA[Vineela]]></dc:creator><pubDate>Thu, 31 Jan 2019 06:02:38 GMT</pubDate></item><item><title><![CDATA[Reply to Displaying my data to QTableWidget on Thu, 31 Jan 2019 04:43:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vronin">@<bdi>VRonin</bdi></a> thanks ,yes i've changed it to table view but the whole table is displaying so how can i select only those three columns ?</p>
]]></description><link>https://forum.qt.io/post/508487</link><guid isPermaLink="true">https://forum.qt.io/post/508487</guid><dc:creator><![CDATA[Vineela]]></dc:creator><pubDate>Thu, 31 Jan 2019 04:43:21 GMT</pubDate></item><item><title><![CDATA[Reply to Displaying my data to QTableWidget on Wed, 30 Jan 2019 14:55:09 GMT]]></title><description><![CDATA[<p dir="auto">Slow down, you are overcomplicating massively.</p>
<ul>
<li>Replace the <code>QTableWidget</code> with a <code>QTableView</code></li>
<li>use the code below:</li>
</ul>
<pre><code class="language-cpp">QSqlTableModel* model = new QSqlTableModel(this);
model-&gt;setTable(QStringLiteral("cuttorderTable"));
model-&gt;setFilter(QStringLiteral("flag = '1'"));
model-&gt;select();
ui-&gt;tableView-&gt;setModel(model);
</code></pre>
<p dir="auto">P.S.</p>
<blockquote>
<p dir="auto"><code>qDebug() &lt;&lt; "Hi thread2";</code></p>
</blockquote>
<p dir="auto">The ui can only be changed by the ui thread and databases can be used only in the thread that created them so be very careful if you are using multiple threads</p>
]]></description><link>https://forum.qt.io/post/508373</link><guid isPermaLink="true">https://forum.qt.io/post/508373</guid><dc:creator><![CDATA[VRonin]]></dc:creator><pubDate>Wed, 30 Jan 2019 14:55:09 GMT</pubDate></item><item><title><![CDATA[Reply to Displaying my data to QTableWidget on Wed, 30 Jan 2019 12:43:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a> well check out this code i know its not correct plz correct me,</p>
<pre><code>QSqlQuery q;
    q.prepare("SELECT * FROM cuttorderTable WHERE flag = '1' ");
    q.exec();
    while (q.next())
    {
     qDebug() &lt;&lt; "Hi thread2";

       QString sn = q.value(0).toString();
        qDebug() &lt;&lt; "sn" &lt;&lt; sn;
         QString i1 = q.value(1).toString();
          qDebug() &lt;&lt; "SEASONCODE" &lt;&lt; i1;
           QString mn = q.value(2).toString();
            qDebug() &lt;&lt; "RYOTNUMBER" &lt;&lt; mn;
             QString j = q.value(3).toString();
              qDebug() &lt;&lt; "VILLAGECODE" &lt;&lt; j;
             QString k = q.value(4).toString();
              qDebug() &lt;&lt; "OFFICERCODE" &lt;&lt; k;
                QString l = q.value(5).toString();
                 qDebug() &lt;&lt; "DATE" &lt;&lt; l;
                 QString m = q.value(6).toString();
                  qDebug() &lt;&lt; "TIME" &lt;&lt; m;
                  QString n = q.value(7).toString();
                   qDebug() &lt;&lt; "OFFICERNAME" &lt;&lt; n;
                  QString o = q.value(8).toString();
                   qDebug() &lt;&lt; "PLOTNUMBER" &lt;&lt; o;
                   QString p = q.value(9).toString();
                    qDebug() &lt;&lt; "CUTTINGORDERCODE" &lt;&lt; p;
                    QString t = q.value(10).toString();
                     qDebug() &lt;&lt; "GANGLEADERCODE" &lt;&lt; t;
                     QString u = q.value(11).toString();
                      qDebug() &lt;&lt; "TRANSPORTERCODE" &lt;&lt; u;
                      QString v = q.value(12).toString();
                       qDebug() &lt;&lt; "MODEOFTRANSPORT" &lt;&lt; v;
                       QString w = q.value(13).toString();
                        qDebug() &lt;&lt; "CROPTYPE" &lt;&lt; w;
                        QString a = q.value(14).toString();
                         qDebug() &lt;&lt; "COB" &lt;&lt; a;

            
                          QTableWidgetItem *mn1 = new QTableWidgetItem(tr("%1").arg(
                           (0+1)*(0+1)));
                          ui-&gt;tableWidget-&gt;setItem(0, 0, mn1);

                          QTableWidgetItem *o1 = new QTableWidgetItem(tr("%1").arg(
                           (0+1)*(1+1)));
                          ui-&gt;tableWidget-&gt;setItem(0, 1, o1);

                          QTableWidgetItem *a1 = new QTableWidgetItem(tr("%1").arg(
                           (0+1)*(2+1)));
                          ui-&gt;tableWidget-&gt;setItem(0, 2, a1);

}
</code></pre>
]]></description><link>https://forum.qt.io/post/508341</link><guid isPermaLink="true">https://forum.qt.io/post/508341</guid><dc:creator><![CDATA[Vineela]]></dc:creator><pubDate>Wed, 30 Jan 2019 12:43:00 GMT</pubDate></item><item><title><![CDATA[Reply to Displaying my data to QTableWidget on Wed, 30 Jan 2019 12:27:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vineela">@<bdi>Vineela</bdi></a> It is shown in the documentation <a href="http://doc.qt.io/qt-5/qtablewidget.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://doc.qt.io/qt-5/qtablewidget.html</a></p>
<pre><code>QTableWidgetItem *newItem = new QTableWidgetItem(tr("%1").arg(
(row+1)*(column+1)));
tableWidget-&gt;setItem(row, column, newItem);
</code></pre>
]]></description><link>https://forum.qt.io/post/508336</link><guid isPermaLink="true">https://forum.qt.io/post/508336</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Wed, 30 Jan 2019 12:27:27 GMT</pubDate></item></channel></rss>