<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.5.0_09) on Tue Aug 07 17:07:13 CEST 2007 --> <TITLE> QSqlQueryModel </TITLE> <META NAME="keywords" CONTENT="com.trolltech.qt.sql.QSqlQueryModel class"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="QSqlQueryModel"; } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../com/trolltech/qt/sql/QSqlQuery.BatchExecutionMode.html" title="enum in com.trolltech.qt.sql"><B>PREV CLASS</B></A> <A HREF="../../../../com/trolltech/qt/sql/QSqlRecord.html" title="class in com.trolltech.qt.sql"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?com/trolltech/qt/sql/QSqlQueryModel.html" target="_top"><B>FRAMES</B></A> <A HREF="QSqlQueryModel.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#nested_classes_inherited_from_class_com.trolltech.qt.QSignalEmitter">NESTED</A> | <A HREF="#fields_inherited_from_class_com.trolltech.qt.core.QAbstractItemModel">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> com.trolltech.qt.sql</FONT> <BR> Class QSqlQueryModel</H2> <PRE> java.lang.Object <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../com/trolltech/qt/QSignalEmitter.html" title="class in com.trolltech.qt">com.trolltech.qt.QSignalEmitter</A> <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../com/trolltech/qt/QtJambiObject.html" title="class in com.trolltech.qt">com.trolltech.qt.QtJambiObject</A> <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../com/trolltech/qt/core/QObject.html" title="class in com.trolltech.qt.core">com.trolltech.qt.core.QObject</A> <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html" title="class in com.trolltech.qt.core">com.trolltech.qt.core.QAbstractItemModel</A> <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../com/trolltech/qt/gui/QAbstractTableModel.html" title="class in com.trolltech.qt.gui">com.trolltech.qt.gui.QAbstractTableModel</A> <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.trolltech.qt.sql.QSqlQueryModel</B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../com/trolltech/qt/QtJambiInterface.html" title="interface in com.trolltech.qt">QtJambiInterface</A></DD> </DL> <DL> <DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../com/trolltech/qt/sql/QSqlTableModel.html" title="class in com.trolltech.qt.sql">QSqlTableModel</A></DD> </DL> <HR> <DL> <DT><PRE>public class <B>QSqlQueryModel</B><DT>extends <A HREF="../../../../com/trolltech/qt/gui/QAbstractTableModel.html" title="class in com.trolltech.qt.gui">QAbstractTableModel</A></DL> </PRE> <P> <p>The <a href="QSqlQueryModel.html#QSqlQueryModel(com.trolltech.qt.core.QObject)"><tt>QSqlQueryModel</tt></a> class provides a read-only data model for SQL result sets.</p> <p><a href="QSqlQueryModel.html#QSqlQueryModel(com.trolltech.qt.core.QObject)"><tt>QSqlQueryModel</tt></a> is a high-level interface for executing SQL statements and traversing the result set. It is built on top of the lower-level <a href="QSqlQuery.html"><tt>QSqlQuery</tt></a> and can be used to provide data to view classes such as <a href="%2E%2E/gui/QTableView.html"><tt>QTableView</tt></a>. For example:</p> <pre> QSqlQueryModel *model = new QSqlQueryModel; model->setQuery("SELECT name, salary FROM employee"); model->setHeaderData(0, Qt::Horizontal, tr("Name")); model->setHeaderData(1, Qt::Horizontal, tr("Salary")); QTableView *view = new QTableView; view->setModel(model); view->show();</pre> <p>We set the model's query, then we set up the labels displayed in the view header.</p> <p><a href="QSqlQueryModel.html#QSqlQueryModel(com.trolltech.qt.core.QObject)"><tt>QSqlQueryModel</tt></a> can also be used to access a database programmatically, without binding it to a view:</p> <pre> QSqlQueryModel model; model.setQuery("SELECT * FROM employee"); int salary = model.record(4).value("salary").toInt();</pre> <p>The code snippet above extracts the <tt>salary</tt> field from record 4 in the result set of the query <tt>SELECT * from employee</tt>. Assuming that <tt>salary</tt> is column 2, we can rewrite the last line as follows:</p> <pre> int salary = model.data(model.index(4, 2)).toInt();</pre> <p>The model is read-only by default. To make it read-write, you must subclass it and reimplement <a href="%2E%2E/core/%2E%2E/core/QAbstractItemModel.html#setData(com.trolltech.qt.core.QModelIndex, java.lang.Object, int)"><tt>setData</tt></a> and <a href="%2E%2E/core/%2E%2E/core/QAbstractItemModel.html#flags(com.trolltech.qt.core.QModelIndex)"><tt>flags</tt></a>. Another option is to use <a href="QSqlTableModel.html"><tt>QSqlTableModel</tt></a>, which provides a read-write model based on a single database table.</p> <p>The sql/querymodel</tt> example illustrates how to use <a href="QSqlQueryModel.html#QSqlQueryModel(com.trolltech.qt.core.QObject)"><tt>QSqlQueryModel</tt></a> to display the result of a query. It also shows how to subclass <a href="QSqlQueryModel.html#QSqlQueryModel(com.trolltech.qt.core.QObject)"><tt>QSqlQueryModel</tt></a> to customize the contents of the data before showing it to the user, and how to create a read-write model based on <a href="QSqlQueryModel.html#QSqlQueryModel(com.trolltech.qt.core.QObject)"><tt>QSqlQueryModel</tt></a>.</p> <p>If the database doesn't return the amount of selected rows in a query, the model will fetch rows incrementally. See <a href="QSqlQueryModel.html#fetchMore(com.trolltech.qt.core.QModelIndex)"><tt>fetchMore</tt></a> for more information.</p> <P> <P> <DL> <DT><B>See Also:</B><DD><a href="QSqlTableModel.html"><tt>QSqlTableModel</tt></a>, <a href="QSqlRelationalTableModel.html"><tt>QSqlRelationalTableModel</tt></a>, <a href="QSqlQuery.html"><tt>QSqlQuery</tt></a>, <a href="%2E%2E/model-view-programming.html">Model/View Programming</tt></a>, <CODE>Model Example</tt></CODE></DL> <HR> <P> <!-- ======== NESTED CLASS SUMMARY ======== --> <A NAME="nested_class_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Nested Class Summary</B></FONT></TH> </TR> </TABLE> <A NAME="nested_classes_inherited_from_class_com.trolltech.qt.QSignalEmitter"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Nested classes/interfaces inherited from class com.trolltech.qt.<A HREF="../../../../com/trolltech/qt/QSignalEmitter.html" title="class in com.trolltech.qt">QSignalEmitter</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal0.html" title="class in com.trolltech.qt">QSignalEmitter.Signal0</A>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal1.html" title="class in com.trolltech.qt">QSignalEmitter.Signal1</A><<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal1.html" title="type parameter in QSignalEmitter.Signal1">A</A>>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal2.html" title="class in com.trolltech.qt">QSignalEmitter.Signal2</A><<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal2.html" title="type parameter in QSignalEmitter.Signal2">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal2.html" title="type parameter in QSignalEmitter.Signal2">B</A>>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal3.html" title="class in com.trolltech.qt">QSignalEmitter.Signal3</A><<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal3.html" title="type parameter in QSignalEmitter.Signal3">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal3.html" title="type parameter in QSignalEmitter.Signal3">B</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal3.html" title="type parameter in QSignalEmitter.Signal3">C</A>>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal4.html" title="class in com.trolltech.qt">QSignalEmitter.Signal4</A><<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal4.html" title="type parameter in QSignalEmitter.Signal4">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal4.html" title="type parameter in QSignalEmitter.Signal4">B</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal4.html" title="type parameter in QSignalEmitter.Signal4">C</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal4.html" title="type parameter in QSignalEmitter.Signal4">D</A>>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal5.html" title="class in com.trolltech.qt">QSignalEmitter.Signal5</A><<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal5.html" title="type parameter in QSignalEmitter.Signal5">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal5.html" title="type parameter in QSignalEmitter.Signal5">B</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal5.html" title="type parameter in QSignalEmitter.Signal5">C</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal5.html" title="type parameter in QSignalEmitter.Signal5">D</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal5.html" title="type parameter in QSignalEmitter.Signal5">E</A>>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal6.html" title="class in com.trolltech.qt">QSignalEmitter.Signal6</A><<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal6.html" title="type parameter in QSignalEmitter.Signal6">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal6.html" title="type parameter in QSignalEmitter.Signal6">B</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal6.html" title="type parameter in QSignalEmitter.Signal6">C</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal6.html" title="type parameter in QSignalEmitter.Signal6">D</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal6.html" title="type parameter in QSignalEmitter.Signal6">E</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal6.html" title="type parameter in QSignalEmitter.Signal6">F</A>>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="class in com.trolltech.qt">QSignalEmitter.Signal7</A><<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="type parameter in QSignalEmitter.Signal7">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="type parameter in QSignalEmitter.Signal7">B</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="type parameter in QSignalEmitter.Signal7">C</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="type parameter in QSignalEmitter.Signal7">D</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="type parameter in QSignalEmitter.Signal7">E</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="type parameter in QSignalEmitter.Signal7">F</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="type parameter in QSignalEmitter.Signal7">G</A>>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="class in com.trolltech.qt">QSignalEmitter.Signal8</A><<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">B</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">C</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">D</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">E</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">F</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">G</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">H</A>>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="class in com.trolltech.qt">QSignalEmitter.Signal9</A><<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">B</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">C</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">D</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">E</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">F</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">G</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">H</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">I</A>></CODE></TD> </TR> </TABLE> <!-- =========== FIELD SUMMARY =========== --> <A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Field Summary</B></FONT></TH> </TR> </TABLE> <A NAME="fields_inherited_from_class_com.trolltech.qt.core.QAbstractItemModel"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Fields inherited from class com.trolltech.qt.core.<A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html" title="class in com.trolltech.qt.core">QAbstractItemModel</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#dataChanged">dataChanged</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#headerDataChanged">headerDataChanged</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#layoutAboutToBeChanged">layoutAboutToBeChanged</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#layoutChanged">layoutChanged</A></CODE></TD> </TR> </TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#QSqlQueryModel()">QSqlQueryModel</A></B>()</CODE> <BR> Equivalent to <a href="QSqlQueryModel.html#QSqlQueryModel(com.trolltech.qt.core.QObject)"><tt>QSqlQueryModel</tt></a>(0).</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#QSqlQueryModel(com.trolltech.qt.core.QObject)">QSqlQueryModel</A></B>(<A HREF="../../../../com/trolltech/qt/core/QObject.html" title="class in com.trolltech.qt.core">QObject</A> parent)</CODE> <BR> Creates an empty <a href="QSqlQueryModel.html#QSqlQueryModel(com.trolltech.qt.core.QObject)"><tt>QSqlQueryModel</tt></a> with the given <tt>parent</tt>.</TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#canFetchMore(com.trolltech.qt.core.QModelIndex)">canFetchMore</A></B>(<A HREF="../../../../com/trolltech/qt/core/QModelIndex.html" title="class in com.trolltech.qt.core">QModelIndex</A> parent)</CODE> <BR> Returns true if it is possible to read more rows from the database.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#clear()">clear</A></B>()</CODE> <BR> Clears the model and releases any acquired resource.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#columnCount(com.trolltech.qt.core.QModelIndex)">columnCount</A></B>(<A HREF="../../../../com/trolltech/qt/core/QModelIndex.html" title="class in com.trolltech.qt.core">QModelIndex</A> parent)</CODE> <BR> This function is reimplemented for internal reasons.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.Object</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#data(com.trolltech.qt.core.QModelIndex, int)">data</A></B>(<A HREF="../../../../com/trolltech/qt/core/QModelIndex.html" title="class in com.trolltech.qt.core">QModelIndex</A> item, int role)</CODE> <BR> Returns the value for the specified <tt>item</tt> and <tt>role</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#fetchMore(com.trolltech.qt.core.QModelIndex)">fetchMore</A></B>(<A HREF="../../../../com/trolltech/qt/core/QModelIndex.html" title="class in com.trolltech.qt.core">QModelIndex</A> parent)</CODE> <BR> Fetches more rows from a database.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html" title="class in com.trolltech.qt.sql">QSqlQueryModel</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#fromNativePointer(com.trolltech.qt.QNativePointer)">fromNativePointer</A></B>(<A HREF="../../../../com/trolltech/qt/QNativePointer.html" title="class in com.trolltech.qt">QNativePointer</A> nativePointer)</CODE> <BR> This function returns the QSqlQueryModel instance pointed to by nativePointer</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.Object</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#headerData(int, com.trolltech.qt.core.Qt.Orientation, int)">headerData</A></B>(int section, <A HREF="../../../../com/trolltech/qt/core/Qt.Orientation.html" title="enum in com.trolltech.qt.core">Qt.Orientation</A> orientation, int role)</CODE> <BR> Returns the header data for the given <tt>role</tt> in the <tt>section</tt> of the header with the specified <tt>orientation</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected <A HREF="../../../../com/trolltech/qt/core/QModelIndex.html" title="class in com.trolltech.qt.core">QModelIndex</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#indexInQuery(com.trolltech.qt.core.QModelIndex)">indexInQuery</A></B>(<A HREF="../../../../com/trolltech/qt/core/QModelIndex.html" title="class in com.trolltech.qt.core">QModelIndex</A> item)</CODE> <BR> Returns the index of the value in the database result set for the given <tt>item</tt> in the model.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#insertColumns(int, int, com.trolltech.qt.core.QModelIndex)">insertColumns</A></B>(int column, int count, <A HREF="../../../../com/trolltech/qt/core/QModelIndex.html" title="class in com.trolltech.qt.core">QModelIndex</A> parent)</CODE> <BR> Inserts <tt>count</tt> columns into the model at position <tt>column</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../com/trolltech/qt/sql/QSqlError.html" title="class in com.trolltech.qt.sql">QSqlError</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#lastError()">lastError</A></B>()</CODE> <BR> Returns information about the last error that occurred on the database.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../com/trolltech/qt/sql/QSqlQuery.html" title="class in com.trolltech.qt.sql">QSqlQuery</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#query()">query</A></B>()</CODE> <BR> Returns the <a href="QSqlQuery.html"><tt>QSqlQuery</tt></a> associated with this model.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#queryChange()">queryChange</A></B>()</CODE> <BR> This virtual function is called whenever the query changes.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../com/trolltech/qt/sql/QSqlRecord.html" title="class in com.trolltech.qt.sql">QSqlRecord</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#record()">record</A></B>()</CODE> <BR> Returns an empty record containing information about the fields of the current query.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../com/trolltech/qt/sql/QSqlRecord.html" title="class in com.trolltech.qt.sql">QSqlRecord</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#record(int)">record</A></B>(int row)</CODE> <BR> Returns the record containing information about the fields of the current query.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#removeColumns(int, int, com.trolltech.qt.core.QModelIndex)">removeColumns</A></B>(int column, int count, <A HREF="../../../../com/trolltech/qt/core/QModelIndex.html" title="class in com.trolltech.qt.core">QModelIndex</A> parent)</CODE> <BR> Removes <tt>count</tt> columns from the model starting from position <tt>column</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#rowCount(com.trolltech.qt.core.QModelIndex)">rowCount</A></B>(<A HREF="../../../../com/trolltech/qt/core/QModelIndex.html" title="class in com.trolltech.qt.core">QModelIndex</A> parent)</CODE> <BR> If the database supports returning the size of a query (see QSqlDriver::hasFeature()), the amount of rows of the current query is returned.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#setHeaderData(int, com.trolltech.qt.core.Qt.Orientation, java.lang.Object, int)">setHeaderData</A></B>(int section, <A HREF="../../../../com/trolltech/qt/core/Qt.Orientation.html" title="enum in com.trolltech.qt.core">Qt.Orientation</A> orientation, java.lang.Object value, int role)</CODE> <BR> Sets the caption for a horizontal header for the specified <tt>role</tt> to <tt>value</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#setLastError(com.trolltech.qt.sql.QSqlError)">setLastError</A></B>(<A HREF="../../../../com/trolltech/qt/sql/QSqlError.html" title="class in com.trolltech.qt.sql">QSqlError</A> error)</CODE> <BR> Protected function which allows derived classes to set the value of the last error that occurred on the database to <tt>error</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#setQuery(com.trolltech.qt.sql.QSqlQuery)">setQuery</A></B>(<A HREF="../../../../com/trolltech/qt/sql/QSqlQuery.html" title="class in com.trolltech.qt.sql">QSqlQuery</A> query)</CODE> <BR> Resets the model and sets the data provider to be the given <tt>query</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#setQuery(java.lang.String)">setQuery</A></B>(java.lang.String query)</CODE> <BR> Equivalent to <a href="QSqlQueryModel.html#setQuery(java.lang.String, com.trolltech.qt.sql.QSqlDatabase)"><tt>setQuery</tt></a>(<tt>query</tt>, QSqlDatabase()).</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html#setQuery(java.lang.String, com.trolltech.qt.sql.QSqlDatabase)">setQuery</A></B>(java.lang.String query, <A HREF="../../../../com/trolltech/qt/sql/QSqlDatabase.html" title="class in com.trolltech.qt.sql">QSqlDatabase</A> db)</CODE> <BR> Executes the query <tt>query</tt> for the given database connection <tt>db</tt>.</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_com.trolltech.qt.gui.QAbstractTableModel"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class com.trolltech.qt.gui.<A HREF="../../../../com/trolltech/qt/gui/QAbstractTableModel.html" title="class in com.trolltech.qt.gui">QAbstractTableModel</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../com/trolltech/qt/gui/QAbstractTableModel.html#dropMimeData(com.trolltech.qt.gui.QMimeData, com.trolltech.qt.core.Qt.DropAction, int, int, com.trolltech.qt.core.QModelIndex)">dropMimeData</A>, <A HREF="../../../../com/trolltech/qt/gui/QAbstractTableModel.html#hasChildren(com.trolltech.qt.core.QModelIndex)">hasChildren</A>, <A HREF="../../../../com/trolltech/qt/gui/QAbstractTableModel.html#index(int, int, com.trolltech.qt.core.QModelIndex)">index</A>, <A HREF="../../../../com/trolltech/qt/gui/QAbstractTableModel.html#parent(com.trolltech.qt.core.QModelIndex)">parent</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_com.trolltech.qt.core.QAbstractItemModel"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class com.trolltech.qt.core.<A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html" title="class in com.trolltech.qt.core">QAbstractItemModel</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#beginInsertColumns(com.trolltech.qt.core.QModelIndex, int, int)">beginInsertColumns</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#beginInsertRows(com.trolltech.qt.core.QModelIndex, int, int)">beginInsertRows</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#beginRemoveColumns(com.trolltech.qt.core.QModelIndex, int, int)">beginRemoveColumns</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#beginRemoveRows(com.trolltech.qt.core.QModelIndex, int, int)">beginRemoveRows</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#buddy(com.trolltech.qt.core.QModelIndex)">buddy</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#changePersistentIndex(com.trolltech.qt.core.QModelIndex, com.trolltech.qt.core.QModelIndex)">changePersistentIndex</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#changePersistentIndexList(java.util.List, java.util.List)">changePersistentIndexList</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#columnCount()">columnCount</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#createIndex(int, int)">createIndex</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#createIndex(int, int, int)">createIndex</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#createIndex(int, int, com.trolltech.qt.QNativePointer)">createIndex</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#data(int, int)">data</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#data(int, int, int)">data</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#data(com.trolltech.qt.core.QModelIndex)">data</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#decodeData(int, int, com.trolltech.qt.core.QModelIndex, com.trolltech.qt.core.QDataStream)">decodeData</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#encodeData(java.util.List, com.trolltech.qt.core.QDataStream)">encodeData</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#endInsertColumns()">endInsertColumns</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#endInsertRows()">endInsertRows</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#endRemoveColumns()">endRemoveColumns</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#endRemoveRows()">endRemoveRows</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#flags(com.trolltech.qt.core.QModelIndex)">flags</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#hasChildren()">hasChildren</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#hasIndex(int, int)">hasIndex</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#hasIndex(int, int, com.trolltech.qt.core.QModelIndex)">hasIndex</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#headerData(int, com.trolltech.qt.core.Qt.Orientation)">headerData</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#index(int, int)">index</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#insertColumn(int)">insertColumn</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#insertColumn(int, com.trolltech.qt.core.QModelIndex)">insertColumn</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#insertColumns(int, int)">insertColumns</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#insertRow(int)">insertRow</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#insertRow(int, com.trolltech.qt.core.QModelIndex)">insertRow</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#insertRows(int, int)">insertRows</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#insertRows(int, int, com.trolltech.qt.core.QModelIndex)">insertRows</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#itemData(com.trolltech.qt.core.QModelIndex)">itemData</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#match(com.trolltech.qt.core.QModelIndex, int, java.lang.Object)">match</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#match(com.trolltech.qt.core.QModelIndex, int, java.lang.Object, int)">match</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#match(com.trolltech.qt.core.QModelIndex, int, java.lang.Object, int, com.trolltech.qt.core.Qt.MatchFlag...)">match</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#match(com.trolltech.qt.core.QModelIndex, int, java.lang.Object, int, com.trolltech.qt.core.Qt.MatchFlags)">match</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#mimeData(java.util.List)">mimeData</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#mimeTypes()">mimeTypes</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#persistentIndexList()">persistentIndexList</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#removeColumn(int)">removeColumn</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#removeColumn(int, com.trolltech.qt.core.QModelIndex)">removeColumn</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#removeColumns(int, int)">removeColumns</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#removeRow(int)">removeRow</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#removeRow(int, com.trolltech.qt.core.QModelIndex)">removeRow</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#removeRows(int, int)">removeRows</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#removeRows(int, int, com.trolltech.qt.core.QModelIndex)">removeRows</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#reset()">reset</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#revert()">revert</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#rowCount()">rowCount</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#setData(int, int, java.lang.Object)">setData</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#setData(int, int, java.lang.Object, int)">setData</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#setData(com.trolltech.qt.core.QModelIndex, java.lang.Object)">setData</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#setData(com.trolltech.qt.core.QModelIndex, java.lang.Object, int)">setData</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#setHeaderData(int, com.trolltech.qt.core.Qt.Orientation, java.lang.Object)">setHeaderData</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#setItemData(com.trolltech.qt.core.QModelIndex, java.util.SortedMap)">setItemData</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#setSupportedDragActions(com.trolltech.qt.core.Qt.DropAction...)">setSupportedDragActions</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#setSupportedDragActions(com.trolltech.qt.core.Qt.DropActions)">setSupportedDragActions</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#sibling(int, int, com.trolltech.qt.core.QModelIndex)">sibling</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#sort(int)">sort</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#sort(int, com.trolltech.qt.core.Qt.SortOrder)">sort</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#span(com.trolltech.qt.core.QModelIndex)">span</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#submit()">submit</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#supportedDragActions()">supportedDragActions</A>, <A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#supportedDropActions()">supportedDropActions</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_com.trolltech.qt.core.QObject"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class com.trolltech.qt.core.<A HREF="../../../../com/trolltech/qt/core/QObject.html" title="class in com.trolltech.qt.core">QObject</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../com/trolltech/qt/core/QObject.html#blockSignals(boolean)">blockSignals</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#childEvent(com.trolltech.qt.core.QChildEvent)">childEvent</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#children()">children</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#connectSlotsByName()">connectSlotsByName</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#customEvent(com.trolltech.qt.core.QEvent)">customEvent</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#disposeLater()">disposeLater</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#dumpObjectInfo()">dumpObjectInfo</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#dumpObjectTree()">dumpObjectTree</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#dynamicPropertyNames()">dynamicPropertyNames</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#event(com.trolltech.qt.core.QEvent)">event</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#eventFilter(com.trolltech.qt.core.QObject, com.trolltech.qt.core.QEvent)">eventFilter</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#findChild()">findChild</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#findChild(java.lang.Class)">findChild</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#findChild(java.lang.Class, java.lang.String)">findChild</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#findChildren()">findChildren</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#findChildren(java.lang.Class)">findChildren</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#findChildren(java.lang.Class, com.trolltech.qt.core.QRegExp)">findChildren</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#findChildren(java.lang.Class, java.lang.String)">findChildren</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#installEventFilter(com.trolltech.qt.core.QObject)">installEventFilter</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#isWidgetType()">isWidgetType</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#killTimer(int)">killTimer</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#moveToThread(java.lang.Thread)">moveToThread</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#objectName()">objectName</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#parent()">parent</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#property(java.lang.String)">property</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#removeEventFilter(com.trolltech.qt.core.QObject)">removeEventFilter</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#setObjectName(java.lang.String)">setObjectName</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#setParent(com.trolltech.qt.core.QObject)">setParent</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#setProperty(java.lang.String, java.lang.Object)">setProperty</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#signalsBlocked()">signalsBlocked</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#startTimer(int)">startTimer</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#thread()">thread</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#timerEvent(com.trolltech.qt.core.QTimerEvent)">timerEvent</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_com.trolltech.qt.QtJambiObject"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class com.trolltech.qt.<A HREF="../../../../com/trolltech/qt/QtJambiObject.html" title="class in com.trolltech.qt">QtJambiObject</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../com/trolltech/qt/QtJambiObject.html#dispose()">dispose</A>, <A HREF="../../../../com/trolltech/qt/QtJambiObject.html#disposed()">disposed</A>, <A HREF="../../../../com/trolltech/qt/QtJambiObject.html#finalize()">finalize</A>, <A HREF="../../../../com/trolltech/qt/QtJambiObject.html#reassignNativeResources(com.trolltech.qt.QtJambiObject, java.lang.Class)">reassignNativeResources</A>, <A HREF="../../../../com/trolltech/qt/QtJambiObject.html#tr(java.lang.String)">tr</A>, <A HREF="../../../../com/trolltech/qt/QtJambiObject.html#tr(java.lang.String, java.lang.String)">tr</A>, <A HREF="../../../../com/trolltech/qt/QtJambiObject.html#tr(java.lang.String, java.lang.String, int)">tr</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_com.trolltech.qt.QSignalEmitter"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class com.trolltech.qt.<A HREF="../../../../com/trolltech/qt/QSignalEmitter.html" title="class in com.trolltech.qt">QSignalEmitter</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../com/trolltech/qt/QSignalEmitter.html#disconnect()">disconnect</A>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.html#disconnect(java.lang.Object)">disconnect</A>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.html#signalSender()">signalSender</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_com.trolltech.qt.QtJambiInterface"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from interface com.trolltech.qt.<A HREF="../../../../com/trolltech/qt/QtJambiInterface.html" title="interface in com.trolltech.qt">QtJambiInterface</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../com/trolltech/qt/QtJambiInterface.html#disableGarbageCollection()">disableGarbageCollection</A>, <A HREF="../../../../com/trolltech/qt/QtJambiInterface.html#nativeId()">nativeId</A>, <A HREF="../../../../com/trolltech/qt/QtJambiInterface.html#nativePointer()">nativePointer</A>, <A HREF="../../../../com/trolltech/qt/QtJambiInterface.html#reenableGarbageCollection()">reenableGarbageCollection</A>, <A HREF="../../../../com/trolltech/qt/QtJambiInterface.html#setJavaOwnership()">setJavaOwnership</A></CODE></TD> </TR> </TABLE> <P> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="QSqlQueryModel()"><!-- --></A><H3> QSqlQueryModel</H3> <PRE> public <B>QSqlQueryModel</B>()</PRE> <DL> <DD><p>Equivalent to <a href="QSqlQueryModel.html#QSqlQueryModel(com.trolltech.qt.core.QObject)"><tt>QSqlQueryModel</tt></a>(0). <P> </DL> <HR> <A NAME="QSqlQueryModel(com.trolltech.qt.core.QObject)"><!-- --></A><H3> QSqlQueryModel</H3> <PRE> public <B>QSqlQueryModel</B>(<A HREF="../../../../com/trolltech/qt/core/QObject.html" title="class in com.trolltech.qt.core">QObject</A> parent)</PRE> <DL> <DD><p>Creates an empty <a href="QSqlQueryModel.html#QSqlQueryModel(com.trolltech.qt.core.QObject)"><tt>QSqlQueryModel</tt></a> with the given <tt>parent</tt>.</p> <P> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="indexInQuery(com.trolltech.qt.core.QModelIndex)"><!-- --></A><H3> indexInQuery</H3> <PRE> protected <A HREF="../../../../com/trolltech/qt/core/QModelIndex.html" title="class in com.trolltech.qt.core">QModelIndex</A> <B>indexInQuery</B>(<A HREF="../../../../com/trolltech/qt/core/QModelIndex.html" title="class in com.trolltech.qt.core">QModelIndex</A> item)</PRE> <DL> <DD><p>Returns the index of the value in the database result set for the given <tt>item</tt> in the model.</p> <p>The return value is identical to <tt>item</tt> if no columns or rows have been inserted, removed, or moved around.</p> <p>Returns an invalid model index if <tt>item</tt> is out of bounds or if <tt>item</tt> does not point to a value in the result set.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><tt>QSqlTableModel::indexInQuery</tt>, <a href="QSqlQueryModel.html#insertColumns(int, int, com.trolltech.qt.core.QModelIndex)"><tt>insertColumns</tt></a>, <a href="QSqlQueryModel.html#removeColumns(int, int, com.trolltech.qt.core.QModelIndex)"><tt>removeColumns</tt></a></DL> </DD> </DL> <HR> <A NAME="lastError()"><!-- --></A><H3> lastError</H3> <PRE> public final <A HREF="../../../../com/trolltech/qt/sql/QSqlError.html" title="class in com.trolltech.qt.sql">QSqlError</A> <B>lastError</B>()</PRE> <DL> <DD><p>Returns information about the last error that occurred on the database.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QSqlQueryModel.html#setLastError(com.trolltech.qt.sql.QSqlError)"><tt>setLastError</tt></a></DL> </DD> </DL> <HR> <A NAME="query()"><!-- --></A><H3> query</H3> <PRE> public final <A HREF="../../../../com/trolltech/qt/sql/QSqlQuery.html" title="class in com.trolltech.qt.sql">QSqlQuery</A> <B>query</B>()</PRE> <DL> <DD><p>Returns the <a href="QSqlQuery.html"><tt>QSqlQuery</tt></a> associated with this model.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QSqlQueryModel.html#setQuery(java.lang.String, com.trolltech.qt.sql.QSqlDatabase)"><tt>setQuery</tt></a></DL> </DD> </DL> <HR> <A NAME="record()"><!-- --></A><H3> record</H3> <PRE> public final <A HREF="../../../../com/trolltech/qt/sql/QSqlRecord.html" title="class in com.trolltech.qt.sql">QSqlRecord</A> <B>record</B>()</PRE> <DL> <DD><p>Returns an empty record containing information about the fields of the current query.</p> <p>If the model is not initialized, an empty record will be returned.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><tt>QSqlRecord::isEmpty</tt></DL> </DD> </DL> <HR> <A NAME="record(int)"><!-- --></A><H3> record</H3> <PRE> public final <A HREF="../../../../com/trolltech/qt/sql/QSqlRecord.html" title="class in com.trolltech.qt.sql">QSqlRecord</A> <B>record</B>(int row)</PRE> <DL> <DD><p>Returns the record containing information about the fields of the current query. If <tt>row</tt> is the index of a valid row, the record will be populated with values from that row.</p> <p>If the model is not initialized, an empty record will be returned.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><tt>QSqlRecord::isEmpty</tt></DL> </DD> </DL> <HR> <A NAME="setLastError(com.trolltech.qt.sql.QSqlError)"><!-- --></A><H3> setLastError</H3> <PRE> protected final void <B>setLastError</B>(<A HREF="../../../../com/trolltech/qt/sql/QSqlError.html" title="class in com.trolltech.qt.sql">QSqlError</A> error)</PRE> <DL> <DD><p>Protected function which allows derived classes to set the value of the last error that occurred on the database to <tt>error</tt>.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QSqlQueryModel.html#lastError()"><tt>lastError</tt></a></DL> </DD> </DL> <HR> <A NAME="setQuery(java.lang.String)"><!-- --></A><H3> setQuery</H3> <PRE> public final void <B>setQuery</B>(java.lang.String query)</PRE> <DL> <DD><p>Equivalent to <a href="QSqlQueryModel.html#setQuery(java.lang.String, com.trolltech.qt.sql.QSqlDatabase)"><tt>setQuery</tt></a>(<tt>query</tt>, QSqlDatabase()). <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="setQuery(java.lang.String, com.trolltech.qt.sql.QSqlDatabase)"><!-- --></A><H3> setQuery</H3> <PRE> public final void <B>setQuery</B>(java.lang.String query, <A HREF="../../../../com/trolltech/qt/sql/QSqlDatabase.html" title="class in com.trolltech.qt.sql">QSqlDatabase</A> db)</PRE> <DL> <DD><p>Executes the query <tt>query</tt> for the given database connection <tt>db</tt>. If no database is specified, the default connection is used.</p> <p><a href="QSqlQueryModel.html#lastError()"><tt>lastError</tt></a> can be used to retrieve verbose information if there was an error setting the query.</p> <p>Example:</p> <pre> QSqlQueryModel model; model.setQuery("select * from MyTable"); if (model.lastError().isValid()) qDebug() << model.lastError();</pre> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QSqlQueryModel.html#query()"><tt>query</tt></a>, <a href="QSqlQueryModel.html#queryChange()"><tt>queryChange</tt></a>, <a href="QSqlQueryModel.html#lastError()"><tt>lastError</tt></a></DL> </DD> </DL> <HR> <A NAME="setQuery(com.trolltech.qt.sql.QSqlQuery)"><!-- --></A><H3> setQuery</H3> <PRE> public void <B>setQuery</B>(<A HREF="../../../../com/trolltech/qt/sql/QSqlQuery.html" title="class in com.trolltech.qt.sql">QSqlQuery</A> query)</PRE> <DL> <DD><p>Resets the model and sets the data provider to be the given <tt>query</tt>. Note that the query must be active and must not be isForwardOnly().</p> <p><a href="QSqlQueryModel.html#lastError()"><tt>lastError</tt></a> can be used to retrieve verbose information if there was an error setting the query.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QSqlQueryModel.html#query()"><tt>query</tt></a>, <tt>QSqlQuery::isActive</tt>, <tt>QSqlQuery::setForwardOnly</tt>, <a href="QSqlQueryModel.html#lastError()"><tt>lastError</tt></a></DL> </DD> </DL> <HR> <A NAME="canFetchMore(com.trolltech.qt.core.QModelIndex)"><!-- --></A><H3> canFetchMore</H3> <PRE> public boolean <B>canFetchMore</B>(<A HREF="../../../../com/trolltech/qt/core/QModelIndex.html" title="class in com.trolltech.qt.core">QModelIndex</A> parent)</PRE> <DL> <DD><p>Returns true if it is possible to read more rows from the database. This only affects databases that don't report back the size of a query (see QSqlDriver::hasFeature()).</p> <p><tt>parent</tt> should always be an invalid QModelIndex.</p> <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#canFetchMore(com.trolltech.qt.core.QModelIndex)">canFetchMore</A></CODE> in class <CODE><A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html" title="class in com.trolltech.qt.core">QAbstractItemModel</A></CODE></DL> </DD> <DD><DL> <DT><B>See Also:</B><DD><a href="QSqlQueryModel.html#fetchMore(com.trolltech.qt.core.QModelIndex)"><tt>fetchMore</tt></a></DL> </DD> </DL> <HR> <A NAME="clear()"><!-- --></A><H3> clear</H3> <PRE> public void <B>clear</B>()</PRE> <DL> <DD><p>Clears the model and releases any acquired resource.</p> <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="columnCount(com.trolltech.qt.core.QModelIndex)"><!-- --></A><H3> columnCount</H3> <PRE> public int <B>columnCount</B>(<A HREF="../../../../com/trolltech/qt/core/QModelIndex.html" title="class in com.trolltech.qt.core">QModelIndex</A> parent)</PRE> <DL> <DD><p>This function is reimplemented for internal reasons.</p> <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#columnCount(com.trolltech.qt.core.QModelIndex)">columnCount</A></CODE> in class <CODE><A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html" title="class in com.trolltech.qt.core">QAbstractItemModel</A></CODE></DL> </DD> <DD><DL> <DT><B>See Also:</B><DD><a href="QAbstractItemModel.html#rowCount(com.trolltech.qt.core.QModelIndex)"><tt>rowCount</tt></a></DL> </DD> </DL> <HR> <A NAME="data(com.trolltech.qt.core.QModelIndex, int)"><!-- --></A><H3> data</H3> <PRE> public java.lang.Object <B>data</B>(<A HREF="../../../../com/trolltech/qt/core/QModelIndex.html" title="class in com.trolltech.qt.core">QModelIndex</A> item, int role)</PRE> <DL> <DD><p>Returns the value for the specified <tt>item</tt> and <tt>role</tt>.</p> <p>If <tt>item</tt> is out of bounds or if an error occurred, an invalid <a href="%2E%2E/porting4.html#qvariant"><tt>QVariant</tt></a> is returned.</p> <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#data(com.trolltech.qt.core.QModelIndex, int)">data</A></CODE> in class <CODE><A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html" title="class in com.trolltech.qt.core">QAbstractItemModel</A></CODE></DL> </DD> <DD><DL> <DT><B>See Also:</B><DD><a href="QSqlQueryModel.html#lastError()"><tt>lastError</tt></a></DL> </DD> </DL> <HR> <A NAME="fetchMore(com.trolltech.qt.core.QModelIndex)"><!-- --></A><H3> fetchMore</H3> <PRE> public void <B>fetchMore</B>(<A HREF="../../../../com/trolltech/qt/core/QModelIndex.html" title="class in com.trolltech.qt.core">QModelIndex</A> parent)</PRE> <DL> <DD><p>Fetches more rows from a database. This only affects databases that don't report back the size of a query (see QSqlDriver::hasFeature()).</p> <p>To force fetching of the entire database, you can use the following:</p> <pre> while (myModel->canFetchMore()) myModel->fetchMore();</pre> <p><tt>parent</tt> should always be an invalid QModelIndex.</p> <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#fetchMore(com.trolltech.qt.core.QModelIndex)">fetchMore</A></CODE> in class <CODE><A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html" title="class in com.trolltech.qt.core">QAbstractItemModel</A></CODE></DL> </DD> <DD><DL> <DT><B>See Also:</B><DD><a href="QSqlQueryModel.html#canFetchMore(com.trolltech.qt.core.QModelIndex)"><tt>canFetchMore</tt></a></DL> </DD> </DL> <HR> <A NAME="headerData(int, com.trolltech.qt.core.Qt.Orientation, int)"><!-- --></A><H3> headerData</H3> <PRE> public java.lang.Object <B>headerData</B>(int section, <A HREF="../../../../com/trolltech/qt/core/Qt.Orientation.html" title="enum in com.trolltech.qt.core">Qt.Orientation</A> orientation, int role)</PRE> <DL> <DD><p>Returns the header data for the given <tt>role</tt> in the <tt>section</tt> of the header with the specified <tt>orientation</tt>.</p> <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#headerData(int, com.trolltech.qt.core.Qt.Orientation, int)">headerData</A></CODE> in class <CODE><A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html" title="class in com.trolltech.qt.core">QAbstractItemModel</A></CODE></DL> </DD> <DD><DL> <DT><B>See Also:</B><DD><a href="QSqlQueryModel.html#setHeaderData(int, com.trolltech.qt.core.Qt.Orientation, java.lang.Object, int)"><tt>setHeaderData</tt></a></DL> </DD> </DL> <HR> <A NAME="insertColumns(int, int, com.trolltech.qt.core.QModelIndex)"><!-- --></A><H3> insertColumns</H3> <PRE> public boolean <B>insertColumns</B>(int column, int count, <A HREF="../../../../com/trolltech/qt/core/QModelIndex.html" title="class in com.trolltech.qt.core">QModelIndex</A> parent)</PRE> <DL> <DD><p>Inserts <tt>count</tt> columns into the model at position <tt>column</tt>. The <tt>parent</tt> parameter must always be an invalid QModelIndex, since the model does not support parent-child relationships.</p> <p>Returns true if <tt>column</tt> is within bounds; otherwise returns false.</p> <p>By default, inserted columns are empty. To fill them with data, reimplement <a href="QSqlQueryModel.html#data(com.trolltech.qt.core.QModelIndex, int)"><tt>data</tt></a> and handle any inserted column separately:</p> <pre> QVariant MyModel::data(const QModelIndex &item, int role) const { if (item.column() == m_specialColumnNo) { <span class="comment">// handle column separately</span> } return QSqlQueryModel::data(item, role); }</pre> <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#insertColumns(int, int, com.trolltech.qt.core.QModelIndex)">insertColumns</A></CODE> in class <CODE><A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html" title="class in com.trolltech.qt.core">QAbstractItemModel</A></CODE></DL> </DD> <DD><DL> <DT><B>See Also:</B><DD><a href="QSqlQueryModel.html#removeColumns(int, int, com.trolltech.qt.core.QModelIndex)"><tt>removeColumns</tt></a></DL> </DD> </DL> <HR> <A NAME="queryChange()"><!-- --></A><H3> queryChange</H3> <PRE> protected void <B>queryChange</B>()</PRE> <DL> <DD><p>This virtual function is called whenever the query changes. The default implementation does nothing.</p> <p><a href="QSqlQueryModel.html#query()"><tt>query</tt></a> returns the new query.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QSqlQueryModel.html#query()"><tt>query</tt></a>, <a href="QSqlQueryModel.html#setQuery(java.lang.String, com.trolltech.qt.sql.QSqlDatabase)"><tt>setQuery</tt></a></DL> </DD> </DL> <HR> <A NAME="removeColumns(int, int, com.trolltech.qt.core.QModelIndex)"><!-- --></A><H3> removeColumns</H3> <PRE> public boolean <B>removeColumns</B>(int column, int count, <A HREF="../../../../com/trolltech/qt/core/QModelIndex.html" title="class in com.trolltech.qt.core">QModelIndex</A> parent)</PRE> <DL> <DD><p>Removes <tt>count</tt> columns from the model starting from position <tt>column</tt>. The <tt>parent</tt> parameter must always be an invalid QModelIndex, since the model does not support parent-child relationships.</p> <p>Removing columns effectively hides them. It does not affect the underlying <a href="QSqlQuery.html"><tt>QSqlQuery</tt></a>.</p> <p>Returns true if the columns were removed; otherwise returns false.</p> <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#removeColumns(int, int, com.trolltech.qt.core.QModelIndex)">removeColumns</A></CODE> in class <CODE><A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html" title="class in com.trolltech.qt.core">QAbstractItemModel</A></CODE></DL> </DD> <DD><DL> <DT><B>See Also:</B><DD><a href="QAbstractItemModel.html#removeColumn(int, com.trolltech.qt.core.QModelIndex)"><tt>removeColumn</tt></a>, <a href="QAbstractItemModel.html#removeRows(int, int, com.trolltech.qt.core.QModelIndex)"><tt>removeRows</tt></a>, <a href="QAbstractItemModel.html#insertColumns(int, int, com.trolltech.qt.core.QModelIndex)"><tt>insertColumns</tt></a>, <a href="QAbstractItemModel.html#beginRemoveColumns(com.trolltech.qt.core.QModelIndex, int, int)"><tt>beginRemoveColumns</tt></a>, <a href="QAbstractItemModel.html#endRemoveColumns()"><tt>endRemoveColumns</tt></a></DL> </DD> </DL> <HR> <A NAME="rowCount(com.trolltech.qt.core.QModelIndex)"><!-- --></A><H3> rowCount</H3> <PRE> public int <B>rowCount</B>(<A HREF="../../../../com/trolltech/qt/core/QModelIndex.html" title="class in com.trolltech.qt.core">QModelIndex</A> parent)</PRE> <DL> <DD><p>If the database supports returning the size of a query (see QSqlDriver::hasFeature()), the amount of rows of the current query is returned. Otherwise, returns the amount of rows currently cached on the client.</p> <p><tt>parent</tt> should always be an invalid QModelIndex.</p> <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#rowCount(com.trolltech.qt.core.QModelIndex)">rowCount</A></CODE> in class <CODE><A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html" title="class in com.trolltech.qt.core">QAbstractItemModel</A></CODE></DL> </DD> <DD><DL> <DT><B>See Also:</B><DD><a href="QSqlQueryModel.html#canFetchMore(com.trolltech.qt.core.QModelIndex)"><tt>canFetchMore</tt></a>, <tt>QSqlDriver::hasFeature</tt></DL> </DD> </DL> <HR> <A NAME="setHeaderData(int, com.trolltech.qt.core.Qt.Orientation, java.lang.Object, int)"><!-- --></A><H3> setHeaderData</H3> <PRE> public boolean <B>setHeaderData</B>(int section, <A HREF="../../../../com/trolltech/qt/core/Qt.Orientation.html" title="enum in com.trolltech.qt.core">Qt.Orientation</A> orientation, java.lang.Object value, int role)</PRE> <DL> <DD><p>Sets the caption for a horizontal header for the specified <tt>role</tt> to <tt>value</tt>. This is useful if the model is used to display data in a view (e.g., <a href="%2E%2E/gui/QTableView.html"><tt>QTableView</tt></a>).</p> <p>Returns true if <tt>orientation</tt> is Qt::Horizontal and the <tt>section</tt> refers to a valid section; otherwise returns false.</p> <p>Note that this function cannot be used to modify values in the database since the model is read-only.</p> <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html#setHeaderData(int, com.trolltech.qt.core.Qt.Orientation, java.lang.Object, int)">setHeaderData</A></CODE> in class <CODE><A HREF="../../../../com/trolltech/qt/core/QAbstractItemModel.html" title="class in com.trolltech.qt.core">QAbstractItemModel</A></CODE></DL> </DD> <DD><DL> <DT><B>See Also:</B><DD><a href="QSqlQueryModel.html#headerData(int, com.trolltech.qt.core.Qt.Orientation, int)"><tt>headerData</tt></a>, <a href="QSqlQueryModel.html#data(com.trolltech.qt.core.QModelIndex, int)"><tt>data</tt></a></DL> </DD> </DL> <HR> <A NAME="fromNativePointer(com.trolltech.qt.QNativePointer)"><!-- --></A><H3> fromNativePointer</H3> <PRE> public static <A HREF="../../../../com/trolltech/qt/sql/QSqlQueryModel.html" title="class in com.trolltech.qt.sql">QSqlQueryModel</A> <B>fromNativePointer</B>(<A HREF="../../../../com/trolltech/qt/QNativePointer.html" title="class in com.trolltech.qt">QNativePointer</A> nativePointer)</PRE> <DL> <DD>This function returns the QSqlQueryModel instance pointed to by nativePointer <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>nativePointer</CODE> - the QNativePointer of which object should be returned.</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../com/trolltech/qt/sql/QSqlQuery.BatchExecutionMode.html" title="enum in com.trolltech.qt.sql"><B>PREV CLASS</B></A> <A HREF="../../../../com/trolltech/qt/sql/QSqlRecord.html" title="class in com.trolltech.qt.sql"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?com/trolltech/qt/sql/QSqlQueryModel.html" target="_top"><B>FRAMES</B></A> <A HREF="QSqlQueryModel.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#nested_classes_inherited_from_class_com.trolltech.qt.QSignalEmitter">NESTED</A> | <A HREF="#fields_inherited_from_class_com.trolltech.qt.core.QAbstractItemModel">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>