Thanks a lot Jeff,<br>I fixed the problem. In fact, cmake could find
the QT locations successfully.But I was forgetting the following lines
(as you are suggesting too): I will copy them here if the others have
similar problems. But note that some of these settings are specific to
our project.<br>
<br>  FIND_PACKAGE(Qt4)<br>  IF(QT4_FOUND)<br>    INCLUDE( ${QT_USE_FILE} )<br>    IF (QT_QTXML_FOUND)<br>      INCLUDE_DIRECTORIES(${QT_<div id=":19b" class="ii gt">QTXML_INCLUDE_DIR})<br>    ELSE(QT_QTXML_FOUND)<br>      MESSAGE(FATAL ERROR &quot;Qt XML libraries missing.&quot;)<br>

    ENDIF(QT_QTXML_FOUND)<br>    #IF (QT_QTHELP_FOUND)<br>    #  INCLUDE_DIRECTORIES(${QT_QTHELP_INCLUDE_DIR})<br>    #ELSE(QT_QTHELP_FOUND)<br>    #  MESSAGE(FATAL ERROR &quot;Qt HELP libraries missing.&quot;)<br>    #ENDIF(QT_QTHELP_FOUND)<br>

  ELSE(QT4_FOUND)<br>    MESSAGE(FATAL_ERROR &quot;Cannot build without Qt4&quot;)<br>  ENDIF(QT4_FOUND)<br><br>Now,
I am trying to run the following code that runs an SQL query, and
displays the results as a text output. But this part does not display
the SQL results in a  tabular form. The table is empty and the program
crashes. I mainly used the code in TestVtkQtTableView.cxx,
TestSQLiteDatabase.cxx and several other related test programs.<br>
<br>Do I need to change anything in the following two blocks of code? why doesn&#39;t the query fill the table with data?<br><br> // Use vtkQtTableView to display the results in a better format<br>  vtkRowQueryToTable* reader = vtkRowQueryToTable::New();<br>

  reader-&gt;SetQuery( query );<br>  reader-&gt;Update();<br>  vtkTable* table = reader-&gt;GetOutput();<br><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>Here is the procedure that has this code:<br>/////////////////////////////////////////////////////////////<br>/////////////////////////////////////////////////////////////<br>

int QueryDB(vtkSQLiteDatabase* db, char* queryText) {<br><br>  vtkSQLQuery* query = db-&gt;GetQueryInstance();<br>  //const char *queryText = &quot;&quot;;<br>  //queryText = &quot;SELECT volume, minimum, Dist_to_Bldv FROM ftkTable WHERE volume &lt;= 100&quot;;<br>

  query-&gt;SetQuery( queryText );<br>  cerr &lt;&lt; endl &lt;&lt; &quot;Running query: &quot; &lt;&lt; query-&gt;GetQuery() &lt;&lt; endl;<br><br>  cerr &lt;&lt; endl &lt;&lt; &quot;Using vtkSQLQuery directly to execute query:&quot; &lt;&lt; endl;<br>

  if (!query-&gt;Execute())<br>    {<br>      cerr &lt;&lt; &quot;Query failed&quot; &lt;&lt; endl;<br>      return 1;<br>    }<br><br>  for ( int col = 0; col &lt; query-&gt;GetNumberOfFields(); col++)<br>    {<br>    if ( col &gt; 0)<br>

      {<br>      cerr &lt;&lt; &quot;, &quot;;<br>      }<br>    cerr &lt;&lt; query-&gt;GetFieldName( col );<br>    }<br>  cerr &lt;&lt; endl;<br>  while ( query-&gt;NextRow())<br>    {<br>    for ( int field = 0; field &lt; query-&gt;GetNumberOfFields(); field++)<br>

      {<br>      if ( field &gt; 0)<br>        {<br>        cerr &lt;&lt; &quot;, &quot;;<br>        }<br>      cerr &lt;&lt; query-&gt;DataValue( field ).ToString().c_str();<br>      }<br>    cerr &lt;&lt; endl;<br>    }<br>

<br>  // Use vtkQtTableView to display the results in a better format<br>  vtkRowQueryToTable* reader = vtkRowQueryToTable::New();<br>  reader-&gt;SetQuery( query );<br>  reader-&gt;Update();<br>  vtkTable* table = reader-&gt;GetOutput();<br>

<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();</div>
<br><br><div class="gmail_quote">On Mon, Oct 19, 2009 at 9:10 AM, Jeff Baumes <span dir="ltr">&lt;<a href="mailto:jeff.baumes@kitware.com">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;">
It looks like the Qt include path is somehow not set up properly. Are<br>
you setting up your application the same way as the VTK examples do in<br>
their CMakeLists? I believe it is not enough to just use the VTK<br>
include dirs, you also have to find Qt in your project separately and<br>
set your include path to have the Qt paths.<br>
<br>
Jeff<br>
<div><div></div><div class="h5"><br>
On Tue, Oct 13, 2009 at 6:43 PM, Aytekin Vargun &lt;<a href="mailto:varguna@gmail.com">varguna@gmail.com</a>&gt; wrote:<br>
&gt; Hello everybody,<br>
&gt; I am currently using vtkSQLiteDatabase and vtkSQLQuery to create and query a<br>
&gt; database. The result is just a text output. I would like to use<br>
&gt; vtkQtTableView as in statsview.cxx program in VTK to display results in a<br>
&gt; better format.<br>
&gt;<br>
&gt; I tried to compile my code after including vtkQtTableView.h but I am getting<br>
&gt; the following error message:<br>
&gt; vtk-nightly\guisupport\qt\vtkQtView.h(27) : fatal error C1083: Cannot open<br>
&gt; include file: &#39;QObject&#39;: No such file or directory<br>
&gt;<br>
&gt; I use QT 4.5.2 which is working pretty good with other applications. I was<br>
&gt; also able to compile VTK examples that use vtkSQL* and related Qt views. For<br>
&gt; example, I compiled statsview.cxx successfully.<br>
&gt;<br>
&gt; This looks like a linking problem to me? What linking library should I use<br>
&gt; to take care of this problem? I checked my cmake. All Qt versions are the<br>
&gt; same!<br>
&gt;<br>
&gt; What other ways can I use to display the data I get after running SQL<br>
&gt; queries?<br>
&gt; Thanks a lot.<br>
&gt; Aytekin<br>
&gt;<br>
&gt; --<br>
&gt; My web page: <a href="http://www.cs.rpi.edu/%7Evargua" target="_blank">http://www.cs.rpi.edu/~vargua</a><br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
&gt;<br>
<font color="#888888"><br>
<br>
<br>
--<br>
Jeff Baumes, Ph.D.<br>
R&amp;D Engineer, Kitware Inc.<br>
(518) 881-4932<br>
<a href="mailto:jeff.baumes@kitware.com">jeff.baumes@kitware.com</a><br>
</font></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>