It works If I use the following block of code instead (It is taken from TestQtSQLDatabase.cxx):<br><br>vtkQtTableModelAdapter* model = new vtkQtTableModelAdapter(table);<br>QTableView* view = new QTableView();<br> view-&gt;setModel(model);<br>
 view-&gt;show();<br><br><br>Please let me know If anybody knows why the first block does not work.<br>Thanks a lot.<br><br>By the way, I have been using VTK nightly for these experiments.<br>Aytekin<br><pre><br></pre><br>
<br><div class="gmail_quote">On Tue, Oct 20, 2009 at 1:54 PM, Aytekin Vargun <span dir="ltr">&lt;<a href="mailto:varguna@gmail.com">varguna@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I just wrote some code to display the data in the table and it works. There is data in the table. It looks like the following code segment does not work as I expected. Also, a table shows up but it disappears quickly. <br>
<div class="im">
<br>  VTK_CREATE(vtkQtTableView, tableView);<br>  tableView-&gt;SetSplitMultiComponentColumns(true);<br>  tableView-&gt;AddRepresentationFromInput(table); //check here<br>  tableView-&gt;Update(); <br>  tableView-&gt;GetWidget()-&gt;show();<br>

<br></div><div><div></div><div class="h5"><div class="gmail_quote">On Tue, Oct 20, 2009 at 1:22 PM, Jeff Baumes <span dir="ltr">&lt;<a href="mailto:jeff.baumes@kitware.com" target="_blank">jeff.baumes@kitware.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>&gt; Now, I am trying to run the following code that runs an SQL query, and<br>
&gt; displays the results as a text output. But this part does not display the<br>
&gt; SQL results in a  tabular form. The table is empty and the program crashes.<br>
&gt; I mainly used the code in TestVtkQtTableView.cxx, TestSQLiteDatabase.cxx and<br>
&gt; several other related test programs.<br>
&gt;<br>
&gt; Do I need to change anything in the following two blocks of code? why<br>
&gt; doesn&#39;t the query fill the table with data?<br>
<br>
</div>I believe SQL queries are one-time-use objects, so once you traverse<br>
them once, they will be &quot;empty&quot;. Try getting rid of your initial<br>
manual traversal, or create a new query for the vtkRowQueryToTable<br>
filter.<br>
<br>
Another useful thing is to &quot;dump&quot; the output table to see what it is<br>
with table-&gt;Dump().<br>
<font color="#888888"><br>
Jeff<br>
</font></blockquote></div><br><br clear="all"><br></div></div>-- <br><div><div></div><div class="h5">My web page: <a href="http://www.cs.rpi.edu/%7Evargua" target="_blank">http://www.cs.rpi.edu/~vargua</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>My web page: <a href="http://www.cs.rpi.edu/~vargua">http://www.cs.rpi.edu/~vargua</a><br>