Qt 4.8
Public Functions | Protected Types | Protected Functions | Private Functions | Properties | Friends | List of all members
QSqlResult Class Referenceabstract

The QSqlResult class provides an abstract interface for accessing data from specific SQL databases. More...

#include <qsqlresult.h>

Inheritance diagram for QSqlResult:
QDB2Result QMYSQLResult QODBCResult QPSQLResult QSqlCachedResult QSqlNullResult QSymSQLResult QIBaseResult QOCIResult QSQLite2Result QSQLiteResult QTDSResult

Public Functions

virtual QVariant handle () const
 Returns the low-level database handle for this result set wrapped in a QVariant or an invalid QVariant if there is no handle. More...
 
virtual ~QSqlResult ()
 Destroys the object and frees any allocated resources. More...
 

Protected Types

enum  BindingSyntax { PositionalBinding, NamedBinding }
 This enum type specifies the different syntaxes for specifying placeholders in prepared queries. More...
 
enum  VirtualHookOperation { BatchOperation, DetachFromResultSet, SetNumericalPrecision, NextResult }
 

Protected Functions

void addBindValue (const QVariant &val, QSql::ParamType type)
 Binds the value val of parameter type paramType to the next available position in the current record (row). More...
 
int at () const
 Returns the current (zero-based) row position of the result. More...
 
BindingSyntax bindingSyntax () const
 Returns the binding syntax used by prepared queries. More...
 
virtual void bindValue (int pos, const QVariant &val, QSql::ParamType type)
 Binds the value val of parameter type paramType to position index in the current record (row). More...
 
virtual void bindValue (const QString &placeholder, const QVariant &val, QSql::ParamType type)
 Binds the value val of parameter type paramType to the placeholder name in the current record (row). More...
 
QSql::ParamType bindValueType (const QString &placeholder) const
 Returns the parameter type for the value bound with the given placeholder name. More...
 
QSql::ParamType bindValueType (int pos) const
 Returns the parameter type for the value bound at position index. More...
 
QVariant boundValue (const QString &placeholder) const
 Returns the value bound by the given placeholder name in the current record (row). More...
 
QVariant boundValue (int pos) const
 Returns the value bound at position index in the current record (row). More...
 
int boundValueCount () const
 Returns the number of bound values in the result. More...
 
QString boundValueName (int pos) const
 Returns the name of the bound value at position index in the current record (row). More...
 
QVector< QVariant > & boundValues () const
 Returns a vector of the result's bound values for the current record (row). More...
 
void clear ()
 Clears the entire result set and releases any associated resources. More...
 
virtual QVariant data (int i)=0
 Returns the data for field index in the current row as a QVariant. More...
 
void detachFromResultSet ()
 
const QSqlDriverdriver () const
 Returns the driver associated with the result. More...
 
virtual bool exec ()
 Executes the query, returning true if successful; otherwise returns false. More...
 
bool execBatch (bool arrayBind=false)
 Executes a prepared query in batch mode if the driver supports it, otherwise emulates a batch execution using bindValue() and exec(). More...
 
QString executedQuery () const
 Returns the query that was actually executed. More...
 
virtual bool fetch (int i)=0
 Positions the result to an arbitrary (zero-based) row index. More...
 
virtual bool fetchFirst ()=0
 Positions the result to the first record (row 0) in the result. More...
 
virtual bool fetchLast ()=0
 Positions the result to the last record (last row) in the result. More...
 
virtual bool fetchNext ()
 Positions the result to the next available record (row) in the result. More...
 
virtual bool fetchPrevious ()
 Positions the result to the previous record (row) in the result. More...
 
bool hasOutValues () const
 Returns true if at least one of the query's bound values is a QSql::Out or a QSql::InOut; otherwise returns false. More...
 
bool isActive () const
 Returns true if the result has records to be retrieved; otherwise returns false. More...
 
bool isForwardOnly () const
 Returns true if you can only scroll forward through the result set; otherwise returns false. More...
 
virtual bool isNull (int i)=0
 Returns true if the field at position index in the current row is null; otherwise returns false. More...
 
bool isSelect () const
 Returns true if the current result is from a SELECT statement; otherwise returns false. More...
 
bool isValid () const
 Returns true if the result is positioned on a valid record (that is, the result is not positioned before the first or after the last record); otherwise returns false. More...
 
QSqlError lastError () const
 Returns the last error associated with the result. More...
 
virtual QVariant lastInsertId () const
 Returns the object ID of the most recent inserted row if the database supports it. More...
 
QString lastQuery () const
 Returns the current SQL query text, or an empty string if there isn't one. More...
 
bool nextResult ()
 
QSql::NumericalPrecisionPolicy numericalPrecisionPolicy () const
 
virtual int numRowsAffected ()=0
 Returns the number of rows affected by the last query executed, or -1 if it cannot be determined or if the query is a SELECT statement. More...
 
virtual bool prepare (const QString &query)
 Prepares the given query for execution; the query will normally use placeholders so that it can be executed repeatedly. More...
 
 QSqlResult (const QSqlDriver *db)
 Creates a QSqlResult using database driver db. More...
 
virtual QSqlRecord record () const
 Returns the current record if the query is active; otherwise returns an empty QSqlRecord. More...
 
virtual bool reset (const QString &sqlquery)=0
 Sets the result to use the SQL statement query for subsequent data retrieval. More...
 
virtual bool savePrepare (const QString &sqlquery)
 Prepares the given query, using the underlying database functionality where possible. More...
 
virtual void setActive (bool a)
 This function is provided for derived classes to set the internal active state to active. More...
 
virtual void setAt (int at)
 This function is provided for derived classes to set the internal (zero-based) row position to index. More...
 
virtual void setForwardOnly (bool forward)
 Sets forward only mode to forward. More...
 
virtual void setLastError (const QSqlError &e)
 This function is provided for derived classes to set the last error to error. More...
 
void setNumericalPrecisionPolicy (QSql::NumericalPrecisionPolicy policy)
 
virtual void setQuery (const QString &query)
 Sets the current query for the result to query. More...
 
virtual void setSelect (bool s)
 This function is provided for derived classes to indicate whether or not the current statement is a SQL SELECT statement. More...
 
virtual int size ()=0
 Returns the size of the SELECT result, or -1 if it cannot be determined or if the query is not a SELECT statement. More...
 
virtual void virtual_hook (int id, void *data)
 

Private Functions

void resetBindCount ()
 

Properties

QSqlResultPrivated
 

Friends

class QSqlQuery
 
class QSqlResultPrivate
 
class QSqlTableModelPrivate
 

Detailed Description

The QSqlResult class provides an abstract interface for accessing data from specific SQL databases.

Attention
Module: QtSql

Normally, you would use QSqlQuery instead of QSqlResult, since QSqlQuery provides a generic wrapper for database-specific implementations of QSqlResult.

If you are implementing your own SQL driver (by subclassing QSqlDriver), you will need to provide your own QSqlResult subclass that implements all the pure virtual functions and other virtual functions that you need.

See also
QSqlDriver

Definition at line 63 of file qsqlresult.h.

Enumerations

◆ BindingSyntax

enum QSqlResult::BindingSyntax
protected

This enum type specifies the different syntaxes for specifying placeholders in prepared queries.

  • PositionalBinding Use the ODBC-style positional syntax, with "?" as placeholders.
  • NamedBinding Use the Oracle-style syntax with named placeholders (e.g., ":id")
  • BindByPosition
  • BindByName
See also
bindingSyntax()
Enumerator
PositionalBinding 
NamedBinding 

Definition at line 74 of file qsqlresult.h.

74  {
77 #ifdef QT3_SUPPORT
78  , BindByPosition = PositionalBinding,
79  BindByName = NamedBinding
80 #endif
81  };

◆ VirtualHookOperation

Warning
This function is not part of the public interface.
Enumerator
BatchOperation 
DetachFromResultSet 
SetNumericalPrecision 
NextResult 

Definition at line 133 of file qsqlresult.h.

Constructors and Destructors

◆ ~QSqlResult()

QSqlResult::~QSqlResult ( )
virtual

Destroys the object and frees any allocated resources.

Definition at line 270 of file qsqlresult.cpp.

271 {
272  delete d;
273 }
QSqlResultPrivate * d
Definition: qsqlresult.h:142

◆ QSqlResult()

QSqlResult::QSqlResult ( const QSqlDriver db)
explicitprotected

Creates a QSqlResult using database driver db.

The object is initialized to an inactive state.

See also
isActive(), driver()

Definition at line 257 of file qsqlresult.cpp.

258 {
259  d = new QSqlResultPrivate(this);
260  d->sqldriver = const_cast<QSqlDriver *>(db);
261  if(db) {
263  }
264 }
friend class QSqlResultPrivate
Definition: qsqlresult.h:67
The QSqlDriver class is an abstract base class for accessing specific SQL databases.
Definition: qsqldriver.h:68
void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy policy)
QSqlResultPrivate * d
Definition: qsqlresult.h:142
QSql::NumericalPrecisionPolicy numericalPrecisionPolicy() const
Returns the current default precision policy for the database connection.
Definition: qsqldriver.cpp:987
QPointer< QSqlDriver > sqldriver
Definition: qsqlresult.cpp:102

Functions

◆ addBindValue()

void QSqlResult::addBindValue ( const QVariant val,
QSql::ParamType  paramType 
)
protected

Binds the value val of parameter type paramType to the next available position in the current record (row).

See also
bindValue()

Definition at line 784 of file qsqlresult.cpp.

785 {
787  bindValue(d->bindCount, val, paramType);
788  ++d->bindCount;
789 }
QSqlResult::BindingSyntax binds
Definition: qsqlresult.cpp:112
virtual void bindValue(int pos, const QVariant &val, QSql::ParamType type)
Binds the value val of parameter type paramType to position index in the current record (row)...
Definition: qsqlresult.cpp:727
QSqlResultPrivate * d
Definition: qsqlresult.h:142
static QByteArray paramType(const QByteArray &ptype, bool *out)

◆ at()

int QSqlResult::at ( ) const
protected

◆ bindingSyntax()

QSqlResult::BindingSyntax QSqlResult::bindingSyntax ( ) const
protected

Returns the binding syntax used by prepared queries.

Definition at line 867 of file qsqlresult.cpp.

868 {
869  return d->binds;
870 }
QSqlResult::BindingSyntax binds
Definition: qsqlresult.cpp:112
QSqlResultPrivate * d
Definition: qsqlresult.h:142

◆ bindValue() [1/2]

void QSqlResult::bindValue ( int  index,
const QVariant val,
QSql::ParamType  paramType 
)
protectedvirtual

Binds the value val of parameter type paramType to position index in the current record (row).

See also
addBindValue()

Reimplemented in QSqlNullResult.

Definition at line 727 of file qsqlresult.cpp.

728 {
731  if (d->values.count() <= index)
732  d->values.resize(index + 1);
733  d->values[index] = val;
734  if (paramType != QSql::In || !d->types.isEmpty())
735  d->types[index] = paramType;
736 }
QSqlResult::BindingSyntax binds
Definition: qsqlresult.cpp:112
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
static QString qFieldSerial(int i)
Definition: qsqlresult.cpp:130
QVector< QVariant > values
Definition: qsqlresult.cpp:116
void resize(int size)
Sets the size of the vector to size.
Definition: qvector.h:342
QSqlResultPrivate * d
Definition: qsqlresult.h:142
bool isEmpty() const
Returns true if the hash contains no items; otherwise returns false.
Definition: qhash.h:297
Definition: qsql.h:67
QHash< int, QSql::ParamType > types
Definition: qsqlresult.cpp:115
static QByteArray paramType(const QByteArray &ptype, bool *out)
quint16 index

◆ bindValue() [2/2]

void QSqlResult::bindValue ( const QString placeholder,
const QVariant val,
QSql::ParamType  paramType 
)
protectedvirtual

Binds the value val of parameter type paramType to the placeholder name in the current record (row).

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Values cannot be bound to multiple locations in the query, eg:

INSERT INTO testtable (id, name, samename) VALUES (:id, :name, :name)

Binding to name will bind to the first :name, but not the second.

Note
Binding an undefined placeholder will result in undefined behavior.
See also
QSqlQuery::bindValue()

Reimplemented in QSqlNullResult.

Definition at line 757 of file qsqlresult.cpp.

759 {
760  d->binds = NamedBinding;
761  // if the index has already been set when doing emulated named
762  // bindings - don't reset it
763  int idx = d->indexes.value(placeholder, -1);
764  if (idx >= 0) {
765  if (d->values.count() <= idx)
766  d->values.resize(idx + 1);
767  d->values[idx] = val;
768  } else {
769  d->values.append(val);
770  idx = d->values.count() - 1;
771  d->indexes[placeholder] = idx;
772  }
773 
774  if (paramType != QSql::In || !d->types.isEmpty())
775  d->types[idx] = paramType;
776 }
QSqlResult::BindingSyntax binds
Definition: qsqlresult.cpp:112
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
QVector< QVariant > values
Definition: qsqlresult.cpp:116
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
void resize(int size)
Sets the size of the vector to size.
Definition: qvector.h:342
QSqlResultPrivate * d
Definition: qsqlresult.h:142
bool isEmpty() const
Returns true if the hash contains no items; otherwise returns false.
Definition: qhash.h:297
void append(const T &t)
Inserts value at the end of the vector.
Definition: qvector.h:573
Definition: qsql.h:67
QHash< int, QSql::ParamType > types
Definition: qsqlresult.cpp:115
static QByteArray paramType(const QByteArray &ptype, bool *out)

◆ bindValueType() [1/2]

QSql::ParamType QSqlResult::bindValueType ( const QString placeholder) const
protected

Returns the parameter type for the value bound with the given placeholder name.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 838 of file qsqlresult.cpp.

Referenced by QDB2Result::exec(), QODBCResult::exec(), QOCIResultPrivate::isBinaryValue(), and QOCIResultPrivate::isOutValue().

839 {
840  return d->types.value(d->indexes.value(placeholder, -1), QSql::In);
841 }
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
QSqlResultPrivate * d
Definition: qsqlresult.h:142
Definition: qsql.h:67
QHash< int, QSql::ParamType > types
Definition: qsqlresult.cpp:115

◆ bindValueType() [2/2]

QSql::ParamType QSqlResult::bindValueType ( int  index) const
protected

Returns the parameter type for the value bound at position index.

See also
boundValue()

Definition at line 824 of file qsqlresult.cpp.

825 {
826  return d->types.value(index, QSql::In);
827 }
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
QSqlResultPrivate * d
Definition: qsqlresult.h:142
Definition: qsql.h:67
QHash< int, QSql::ParamType > types
Definition: qsqlresult.cpp:115
quint16 index

◆ boundValue() [1/2]

QVariant QSqlResult::boundValue ( const QString placeholder) const
protected

Returns the value bound by the given placeholder name in the current record (row).

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
bindValueType()

Definition at line 813 of file qsqlresult.cpp.

814 {
815  int idx = d->indexes.value(placeholder, -1);
816  return d->values.value(idx);
817 }
QVector< QVariant > values
Definition: qsqlresult.cpp:116
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
QSqlResultPrivate * d
Definition: qsqlresult.h:142
T value(int i) const
Returns the value at index position i in the vector.
Definition: qvector.h:559

◆ boundValue() [2/2]

QVariant QSqlResult::boundValue ( int  index) const
protected

Returns the value bound at position index in the current record (row).

See also
bindValue(), boundValues()

Definition at line 797 of file qsqlresult.cpp.

798 {
799  return d->values.value(index);
800 }
QVector< QVariant > values
Definition: qsqlresult.cpp:116
QSqlResultPrivate * d
Definition: qsqlresult.h:142
T value(int i) const
Returns the value at index position i in the vector.
Definition: qvector.h:559
quint16 index

◆ boundValueCount()

int QSqlResult::boundValueCount ( ) const
protected

Returns the number of bound values in the result.

See also
boundValues()

Definition at line 848 of file qsqlresult.cpp.

Referenced by QOCIResult::exec().

849 {
850  return d->values.count();
851 }
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
QVector< QVariant > values
Definition: qsqlresult.cpp:116
QSqlResultPrivate * d
Definition: qsqlresult.h:142

◆ boundValueName()

QString QSqlResult::boundValueName ( int  index) const
protected

Returns the name of the bound value at position index in the current record (row).

See also
boundValue()

Definition at line 905 of file qsqlresult.cpp.

906 {
907  return d->holderAt(index);
908 }
QSqlResultPrivate * d
Definition: qsqlresult.h:142
QString holderAt(int index) const
Definition: qsqlresult.cpp:124
quint16 index

◆ boundValues()

QVector< QVariant > & QSqlResult::boundValues ( ) const
protected

Returns a vector of the result's bound values for the current record (row).

See also
boundValueCount()

Definition at line 859 of file qsqlresult.cpp.

Referenced by QIBaseResult::exec(), QDB2Result::exec(), QOCIResult::exec(), QSQLiteResult::exec(), QSymSQLResult::exec(), QPSQLResult::exec(), QODBCResult::exec(), QOCIResult::virtual_hook(), and QMYSQLResult::virtual_hook().

860 {
861  return d->values;
862 }
QVector< QVariant > values
Definition: qsqlresult.cpp:116
QSqlResultPrivate * d
Definition: qsqlresult.h:142

◆ clear()

void QSqlResult::clear ( void  )
protected

Clears the entire result set and releases any associated resources.

Definition at line 876 of file qsqlresult.cpp.

877 {
878  d->clear();
879 }
QSqlResultPrivate * d
Definition: qsqlresult.h:142

◆ data()

QVariant QSqlResult::data ( int  index)
protectedpure virtual

Returns the data for field index in the current row as a QVariant.

This function is only called if the result is in an active state and is positioned on a valid record and index is non-negative. Derived classes must reimplement this function and return the value of field index, or QVariant() if it cannot be determined.

Implemented in QODBCResult, QMYSQLResult, QPSQLResult, QSqlCachedResult, QSymSQLResult, QDB2Result, and QSqlNullResult.

◆ detachFromResultSet()

void QSqlResult::detachFromResultSet ( )
protected
Warning
This function is not part of the public interface.

Definition at line 1020 of file qsqlresult.cpp.

1021 {
1025 }
const QSqlDriver * driver() const
Returns the driver associated with the result.
Definition: qsqlresult.cpp:389
virtual void virtual_hook(int id, void *data)
Definition: qsqlresult.cpp:962
static bool hasFeature(const QDockWidgetPrivate *priv, QDockWidget::DockWidgetFeature feature)
Definition: qdockwidget.cpp:74

◆ driver()

const QSqlDriver * QSqlResult::driver ( ) const
protected

Returns the driver associated with the result.

This is the object that was passed to the constructor.

Definition at line 389 of file qsqlresult.cpp.

Referenced by QIBaseResult::exec(), QPSQLResult::exec(), QODBCResult::fetch(), QIBaseResult::prepare(), QSQLiteResult::prepare(), QSymSQLResult::prepare(), QODBCResult::prepare(), QSQLite2Result::reset(), QPSQLResult::reset(), QMYSQLResult::reset(), QTDSResult::reset(), QODBCResult::reset(), QODBCResult::~QODBCResult(), and QSQLiteResult::~QSQLiteResult().

390 {
391  return d->sqldriver;
392 }
QSqlResultPrivate * d
Definition: qsqlresult.h:142
QPointer< QSqlDriver > sqldriver
Definition: qsqlresult.cpp:102

◆ exec()

bool QSqlResult::exec ( )
protectedvirtual

Executes the query, returning true if successful; otherwise returns false.

See also
prepare()

Reimplemented in QODBCResult, QPSQLResult, QSqlNullResult, QSymSQLResult, QSQLiteResult, QOCIResult, QDB2Result, and QIBaseResult.

Definition at line 675 of file qsqlresult.cpp.

Referenced by QPSQLResult::exec(), and QMYSQLResult::virtual_hook().

676 {
677  bool ret;
678  // fake preparation - just replace the placeholders..
679  QString query = lastQuery();
680  if (d->binds == NamedBinding) {
681  int i;
682  QVariant val;
683  QString holder;
684  for (i = d->holders.count() - 1; i >= 0; --i) {
685  holder = d->holders.at(i).holderName;
686  val = d->values.value(d->indexes.value(holder));
687  QSqlField f(QLatin1String(""), val.type());
688  f.setValue(val);
689  query = query.replace(d->holders.at(i).holderPos,
690  holder.length(), driver()->formatValue(f));
691  }
692  } else {
693  QString val;
694  int i = 0;
695  int idx = 0;
696  for (idx = 0; idx < d->values.count(); ++idx) {
697  i = query.indexOf(QLatin1Char('?'), i);
698  if (i == -1)
699  continue;
700  QVariant var = d->values.value(idx);
701  QSqlField f(QLatin1String(""), var.type());
702  if (var.isNull())
703  f.clear();
704  else
705  f.setValue(var);
706  val = driver()->formatValue(f);
707  query = query.replace(i, 1, driver()->formatValue(f));
708  i += val.length();
709  }
710  }
711 
712  // have to retain the original query with placeholders
713  QString orig = lastQuery();
714  ret = reset(query);
715  d->executedQuery = query;
716  setQuery(orig);
717  d->resetBindCount();
718  return ret;
719 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
QSqlResult::BindingSyntax binds
Definition: qsqlresult.cpp:112
const QSqlDriver * driver() const
Returns the driver associated with the result.
Definition: qsqlresult.cpp:389
bool isNull() const
Returns true if this is a NULL variant, false otherwise.
Definition: qvariant.cpp:3102
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
QString & replace(int i, int len, QChar after)
Definition: qstring.cpp:2005
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
QVector< QVariant > values
Definition: qsqlresult.cpp:116
QString lastQuery() const
Returns the current SQL query text, or an empty string if there isn&#39;t one.
Definition: qsqlresult.cpp:294
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
QSqlResultPrivate * d
Definition: qsqlresult.h:142
T value(int i) const
Returns the value at index position i in the vector.
Definition: qvector.h:559
void clear()
Clears the value of the field and sets it to NULL.
Definition: qsqlfield.cpp:334
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.cpp:2838
QString holderName
Definition: qsqlresult.cpp:60
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
virtual bool reset(const QString &sqlquery)=0
Sets the result to use the SQL statement query for subsequent data retrieval.
int holderPos
Definition: qsqlresult.cpp:61
Type type() const
Returns the storage type of the value stored in the variant.
Definition: qvariant.cpp:1901
virtual QString formatValue(const QSqlField &field, bool trimStrings=false) const
Returns a string representation of the field value for the database.
Definition: qsqldriver.cpp:597
The QSqlField class manipulates the fields in SQL database tables and views.
Definition: qsqlfield.h:56
QHolderVector holders
Definition: qsqlresult.cpp:121
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
virtual void setQuery(const QString &query)
Sets the current query for the result to query.
Definition: qsqlresult.cpp:282
void setValue(const QVariant &value)
Sets the value of the field to value.
Definition: qsqlfield.cpp:320

◆ execBatch()

bool QSqlResult::execBatch ( bool  arrayBind = false)
protected

Executes a prepared query in batch mode if the driver supports it, otherwise emulates a batch execution using bindValue() and exec().

Warning
This function is not part of the public interface.
Since
4.2

QSqlDriver::hasFeature() can be used to find out whether a driver supports batch execution.

Batch execution can be faster for large amounts of data since it reduces network roundtrips.

For batch executions, bound values have to be provided as lists of variants (QVariantList).

Each list must contain values of the same type. All lists must contain equal amount of values (rows).

NULL values are passed in as typed QVariants, for example {QVariant(QVariant::Int)} for an integer NULL value.

Example:

q.prepare("insert into test (i1, i2, s) values (?, ?, ?)");
col1 << 1 << 3;
col2 << 2 << 4;
col3 << "hello" << "world";
q.bindValue(0, col1);
q.bindValue(1, col2);
q.bindValue(2, col3);
if (!q.execBatch())
qDebug() << q.lastError();

Here, we insert two rows into a SQL table, with each row containing three values.

See also
exec(), QSqlDriver::hasFeature()

Definition at line 997 of file qsqlresult.cpp.

998 {
1000  virtual_hook(BatchOperation, &arrayBind);
1001  d->resetBindCount();
1002  return d->error.type() == QSqlError::NoError;
1003  } else {
1005  if (values.count() == 0)
1006  return false;
1007  for (int i = 0; i < values.at(0).toList().count(); ++i) {
1008  for (int j = 0; j < values.count(); ++j)
1009  bindValue(j, values.at(j).toList().at(i), QSql::In);
1010  if (!exec())
1011  return false;
1012  }
1013  return true;
1014  }
1015  return false;
1016 }
const QSqlDriver * driver() const
Returns the driver associated with the result.
Definition: qsqlresult.cpp:389
ErrorType type() const
Returns the error type, or -1 if the type cannot be determined.
Definition: qsqlerror.cpp:191
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
QList< QVariant > toList() const
Returns the variant as a QVariantList if the variant has type() List or StringList ; otherwise return...
Definition: qvariant.cpp:2751
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
virtual void bindValue(int pos, const QVariant &val, QSql::ParamType type)
Binds the value val of parameter type paramType to position index in the current record (row)...
Definition: qsqlresult.cpp:727
QVector< QVariant > values
Definition: qsqlresult.cpp:116
QSqlResultPrivate * d
Definition: qsqlresult.h:142
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
Definition: qsql.h:67
quint16 values[128]
virtual bool exec()
Executes the query, returning true if successful; otherwise returns false.
Definition: qsqlresult.cpp:675
virtual void virtual_hook(int id, void *data)
Definition: qsqlresult.cpp:962
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
static bool hasFeature(const QDockWidgetPrivate *priv, QDockWidget::DockWidgetFeature feature)
Definition: qdockwidget.cpp:74

◆ executedQuery()

QString QSqlResult::executedQuery ( ) const
protected

Returns the query that was actually executed.

This may differ from the query that was passed, for example if bound values were used with a prepared query and the underlying database doesn't support prepared queries.

See also
exec(), setQuery()

Definition at line 889 of file qsqlresult.cpp.

890 {
891  return d->executedQuery;
892 }
QSqlResultPrivate * d
Definition: qsqlresult.h:142

◆ fetch()

bool QSqlResult::fetch ( int  index)
protectedpure virtual

Positions the result to an arbitrary (zero-based) row index.

This function is only called if the result is in an active state. Derived classes must reimplement this function and position the result to the row index, and call setAt() with an appropriate value. Return true to indicate success, or false to signify failure.

See also
isActive(), fetchFirst(), fetchLast(), fetchNext(), fetchPrevious()

Implemented in QODBCResult, QSqlCachedResult, QMYSQLResult, QPSQLResult, QSymSQLResult, QDB2Result, and QSqlNullResult.

◆ fetchFirst()

bool QSqlResult::fetchFirst ( )
protectedpure virtual

Positions the result to the first record (row 0) in the result.

This function is only called if the result is in an active state. Derived classes must reimplement this function and position the result to the first record, and call setAt() with an appropriate value. Return true to indicate success, or false to signify failure.

See also
fetch(), fetchLast()

Implemented in QODBCResult, QSqlCachedResult, QMYSQLResult, QSymSQLResult, QPSQLResult, QDB2Result, and QSqlNullResult.

◆ fetchLast()

bool QSqlResult::fetchLast ( )
protectedpure virtual

Positions the result to the last record (last row) in the result.

This function is only called if the result is in an active state. Derived classes must reimplement this function and position the result to the last record, and call setAt() with an appropriate value. Return true to indicate success, or false to signify failure.

See also
fetch(), fetchFirst()

Implemented in QODBCResult, QSqlCachedResult, QMYSQLResult, QSymSQLResult, QPSQLResult, QDB2Result, and QSqlNullResult.

◆ fetchNext()

bool QSqlResult::fetchNext ( )
protectedvirtual

Positions the result to the next available record (row) in the result.

This function is only called if the result is in an active state. The default implementation calls fetch() with the next index. Derived classes can reimplement this function and position the result to the next record in some other way, and call setAt() with an appropriate value. Return true to indicate success, or false to signify failure.

See also
fetch(), fetchPrevious()

Reimplemented in QODBCResult, QSqlCachedResult, QMYSQLResult, QSymSQLResult, and QDB2Result.

Definition at line 555 of file qsqlresult.cpp.

556 {
557  return fetch(at() + 1);
558 }
int at() const
Returns the current (zero-based) row position of the result.
Definition: qsqlresult.cpp:306
virtual bool fetch(int i)=0
Positions the result to an arbitrary (zero-based) row index.

◆ fetchPrevious()

bool QSqlResult::fetchPrevious ( )
protectedvirtual

Positions the result to the previous record (row) in the result.

This function is only called if the result is in an active state. The default implementation calls fetch() with the previous index. Derived classes can reimplement this function and position the result to the next record in some other way, and call setAt() with an appropriate value. Return true to indicate success, or false to signify failure.

Reimplemented in QODBCResult, QSqlCachedResult, and QSymSQLResult.

Definition at line 571 of file qsqlresult.cpp.

Referenced by QSymSQLResult::fetchPrevious().

572 {
573  return fetch(at() - 1);
574 }
int at() const
Returns the current (zero-based) row position of the result.
Definition: qsqlresult.cpp:306
virtual bool fetch(int i)=0
Positions the result to an arbitrary (zero-based) row index.

◆ handle()

QVariant QSqlResult::handle ( ) const
virtual

Returns the low-level database handle for this result set wrapped in a QVariant or an invalid QVariant if there is no handle.

Warning
Use this with uttermost care and only if you know what you're doing.
The handle returned here can become a stale pointer if the result is modified (for example, if you clear it).
The handle can be NULL if the result was not executed yet.

The handle returned here is database-dependent, you should query the type name of the variant before accessing it.

This example retrieves the handle for a sqlite result:

QSqlQuery query = ...
QVariant v = query.result()->handle();
if (v.isValid() && qstrcmp(v.typeName(), "sqlite3_stmt*")) {
// v.data() returns a pointer to the handle
sqlite3_stmt *handle = *static_cast<sqlite3_stmt **>(v.data());
if (handle != 0) { // check that it is not NULL
...
}
}

This snippet returns the handle for PostgreSQL or MySQL:

if (v.typeName() == "PGresult*") {
PGresult *handle = *static_cast<PGresult **>(v.data());
if (handle != 0) ...
}
if (v.typeName() == "MYSQL_STMT*") {
MYSQL_STMT *handle = *static_cast<MYSQL_STMT **>(v.data());
if (handle != 0) ...
}
See also
QSqlDriver::handle()

Reimplemented in QODBCResult, QTDSResult, QMYSQLResult, QOCIResult, QPSQLResult, QSQLite2Result, QSymSQLResult, QSQLiteResult, QDB2Result, and QIBaseResult.

Definition at line 1078 of file qsqlresult.cpp.

1079 {
1080  return QVariant();
1081 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92

◆ hasOutValues()

bool QSqlResult::hasOutValues ( ) const
protected

Returns true if at least one of the query's bound values is a QSql::Out or a QSql::InOut; otherwise returns false.

See also
bindValueType()

Definition at line 916 of file qsqlresult.cpp.

Referenced by QDB2Result::exec(), QOCIResult::exec(), and QODBCResult::exec().

917 {
918  if (d->types.isEmpty())
919  return false;
921  for (it = d->types.constBegin(); it != d->types.constEnd(); ++it) {
922  if (it.value() != QSql::In)
923  return true;
924  }
925  return false;
926 }
#define it(className, varName)
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
QSqlResultPrivate * d
Definition: qsqlresult.h:142
bool isEmpty() const
Returns true if the hash contains no items; otherwise returns false.
Definition: qhash.h:297
Definition: qsql.h:67
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the hash.
Definition: qhash.h:466
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:469
QHash< int, QSql::ParamType > types
Definition: qsqlresult.cpp:115

◆ isActive()

bool QSqlResult::isActive ( ) const
protected

◆ isForwardOnly()

bool QSqlResult::isForwardOnly ( ) const
protected

◆ isNull()

bool QSqlResult::isNull ( int  i)
protectedpure virtual

Returns true if the field at position index in the current row is null; otherwise returns false.

Implemented in QODBCResult, QMYSQLResult, QPSQLResult, QSqlCachedResult, QDB2Result, QSymSQLResult, and QSqlNullResult.

◆ isSelect()

bool QSqlResult::isSelect ( ) const
protected

◆ isValid()

bool QSqlResult::isValid ( ) const
protected

Returns true if the result is positioned on a valid record (that is, the result is not positioned before the first or after the last record); otherwise returns false.

See also
at()

Definition at line 320 of file qsqlresult.cpp.

Referenced by QSQLiteResult::exec(), QSymSQLResult::exec(), and QSQLite2Result::reset().

321 {
322  return d->idx != QSql::BeforeFirstRow && d->idx != QSql::AfterLastRow;
323 }
QSqlResultPrivate * d
Definition: qsqlresult.h:142

◆ lastError()

QSqlError QSqlResult::lastError ( ) const
protected

Returns the last error associated with the result.

Definition at line 427 of file qsqlresult.cpp.

Referenced by QSQLiteResult::exec(), QSymSQLResult::exec(), and QSQLite2Result::reset().

428 {
429  return d->error;
430 }
QSqlResultPrivate * d
Definition: qsqlresult.h:142

◆ lastInsertId()

QVariant QSqlResult::lastInsertId ( ) const
protectedvirtual

Returns the object ID of the most recent inserted row if the database supports it.

An invalid QVariant will be returned if the query did not insert any value or if the database does not report the id back. If more than one row was touched by the insert, the behavior is undefined.

Note that for Oracle databases the row's ROWID will be returned, while for MySQL databases the row's auto-increment field will be returned.

See also
QSqlDriver::hasFeature()

Reimplemented in QSymSQLResult, QMYSQLResult, QPSQLResult, QOCIResult, and QSQLiteResult.

Definition at line 955 of file qsqlresult.cpp.

956 {
957  return QVariant();
958 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92

◆ lastQuery()

QString QSqlResult::lastQuery ( ) const
protected

Returns the current SQL query text, or an empty string if there isn't one.

See also
setQuery()

Definition at line 294 of file qsqlresult.cpp.

Referenced by QOCIResult::exec(), QSymSQLResult::exec(), and QOCIResult::gotoNext().

295 {
296  return d->sql;
297 }
QSqlResultPrivate * d
Definition: qsqlresult.h:142

◆ nextResult()

bool QSqlResult::nextResult ( )
protected
Warning
This function is not part of the public interface.

Definition at line 1044 of file qsqlresult.cpp.

1045 {
1047  bool result = false;
1048  virtual_hook(NextResult, &result);
1049  return result;
1050  }
1051  return false;
1052 }
const QSqlDriver * driver() const
Returns the driver associated with the result.
Definition: qsqlresult.cpp:389
virtual void virtual_hook(int id, void *data)
Definition: qsqlresult.cpp:962
static bool hasFeature(const QDockWidgetPrivate *priv, QDockWidget::DockWidgetFeature feature)
Definition: qdockwidget.cpp:74

◆ numericalPrecisionPolicy()

QSql::NumericalPrecisionPolicy QSqlResult::numericalPrecisionPolicy ( ) const
protected
Warning
This function is not part of the public interface.

Definition at line 1037 of file qsqlresult.cpp.

Referenced by QDB2Result::data(), QSymSQLResult::data(), QPSQLResult::data(), QMYSQLResult::data(), QODBCResult::data(), QSQLiteResultPrivate::fetchNext(), QOCICols::getValues(), QIBaseResult::gotoNext(), and QOCICols::qMakeOraField().

1038 {
1039  return d->precisionPolicy;
1040 }
QSqlResultPrivate * d
Definition: qsqlresult.h:142
QSql::NumericalPrecisionPolicy precisionPolicy
Definition: qsqlresult.cpp:109

◆ numRowsAffected()

int QSqlResult::numRowsAffected ( )
protectedpure virtual

Returns the number of rows affected by the last query executed, or -1 if it cannot be determined or if the query is a SELECT statement.

See also
size()

Implemented in QODBCResult, QTDSResult, QMYSQLResult, QSymSQLResult, QPSQLResult, QOCIResult, QDB2Result, QSQLiteResult, QSQLite2Result, QSqlNullResult, and QIBaseResult.

◆ prepare()

bool QSqlResult::prepare ( const QString query)
protectedvirtual

Prepares the given query for execution; the query will normally use placeholders so that it can be executed repeatedly.

Returns true if the query is prepared successfully; otherwise returns false.

See also
exec()

Reimplemented in QODBCResult, QPSQLResult, QSqlNullResult, QSymSQLResult, QSQLiteResult, QOCIResult, QDB2Result, and QIBaseResult.

Definition at line 641 of file qsqlresult.cpp.

Referenced by QOCIResult::prepare(), QPSQLResult::prepare(), and QMYSQLResult::virtual_hook().

642 {
643  int n = query.size();
644 
645  bool inQuote = false;
646  int i = 0;
647 
648  while (i < n) {
649  QChar ch = query.at(i);
650  if (ch == QLatin1Char(':') && !inQuote
651  && (i == 0 || query.at(i - 1) != QLatin1Char(':'))
652  && (i + 1 < n && qIsAlnum(query.at(i + 1)))) {
653  int pos = i + 2;
654  while (pos < n && qIsAlnum(query.at(pos)))
655  ++pos;
656 
657  d->holders.append(QHolder(query.mid(i, pos - i), i));
658  i = pos;
659  } else {
660  if (ch == QLatin1Char('\''))
661  inQuote = !inQuote;
662  ++i;
663  }
664  }
665  d->sql = query;
666  return true; // fake prepares should always succeed
667 }
const QChar at(int i) const
Returns the character at the given index position in the string.
Definition: qstring.h:698
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
QSqlResultPrivate * d
Definition: qsqlresult.h:142
int size() const
Returns the number of characters in this string.
Definition: qstring.h:102
void append(const T &t)
Inserts value at the end of the vector.
Definition: qvector.h:573
static bool qIsAlnum(QChar ch)
Definition: qsqlresult.cpp:143
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
Definition: qstring.cpp:3706
QHolderVector holders
Definition: qsqlresult.cpp:121
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55

◆ record()

QSqlRecord QSqlResult::record ( ) const
protectedvirtual

Returns the current record if the query is active; otherwise returns an empty QSqlRecord.

The default implementation always returns an empty QSqlRecord.

See also
isActive()

Reimplemented in QODBCResult, QTDSResult, QMYSQLResult, QSymSQLResult, QPSQLResult, QOCIResult, QDB2Result, QSQLiteResult, QSQLite2Result, and QIBaseResult.

Definition at line 936 of file qsqlresult.cpp.

937 {
938  return QSqlRecord();
939 }
The QSqlRecord class encapsulates a database record.
Definition: qsqlrecord.h:58

◆ reset()

bool QSqlResult::reset ( const QString query)
protectedpure virtual

Sets the result to use the SQL statement query for subsequent data retrieval.

Derived classes must reimplement this function and apply the query to the database. This function is only called after the result is set to an inactive state and is positioned before the first record of the new result. Derived classes should return true if the query was successful and ready to be used, or false otherwise.

See also
setQuery()

Implemented in QODBCResult, QTDSResult, QMYSQLResult, QPSQLResult, QSymSQLResult, QOCIResult, QSQLite2Result, QSQLiteResult, QDB2Result, QIBaseResult, and QSqlNullResult.

◆ resetBindCount()

void QSqlResult::resetBindCount ( )
private

Definition at line 894 of file qsqlresult.cpp.

895 {
896  d->resetBindCount();
897 }
QSqlResultPrivate * d
Definition: qsqlresult.h:142

◆ savePrepare()

bool QSqlResult::savePrepare ( const QString query)
protectedvirtual

Prepares the given query, using the underlying database functionality where possible.

Returns true if the query is prepared successfully; otherwise returns false.

See also
prepare()

Reimplemented in QSqlNullResult.

Definition at line 615 of file qsqlresult.cpp.

616 {
617  if (!driver())
618  return false;
619  d->clear();
620  d->sql = query;
622  return prepare(query);
623 
625  // parse the query to memorize parameter location
628  } else {
630  }
631  return prepare(d->executedQuery);
632 }
const QSqlDriver * driver() const
Returns the driver associated with the result.
Definition: qsqlresult.cpp:389
QSqlResultPrivate * d
Definition: qsqlresult.h:142
virtual bool prepare(const QString &query)
Prepares the given query for execution; the query will normally use placeholders so that it can be ex...
Definition: qsqlresult.cpp:641
static bool hasFeature(const QDockWidgetPrivate *priv, QDockWidget::DockWidgetFeature feature)
Definition: qdockwidget.cpp:74
QString positionalToNamedBinding()
Definition: qsqlresult.cpp:150
QString namedToPositionalBinding()
Definition: qsqlresult.cpp:173

◆ setActive()

void QSqlResult::setActive ( bool  active)
protectedvirtual

◆ setAt()

void QSqlResult::setAt ( int  index)
protectedvirtual

This function is provided for derived classes to set the internal (zero-based) row position to index.

See also
at()

Reimplemented in QSqlNullResult.

Definition at line 352 of file qsqlresult.cpp.

Referenced by QSqlCachedResult::cacheNext(), QSqlCachedResult::cleanup(), QPSQLResult::cleanup(), QMYSQLResult::cleanup(), QSQLite2ResultPrivate::cleanup(), QSQLiteResultPrivate::cleanup(), QSymSQLResultPrivate::cleanup(), QSqlCachedResult::clearValues(), QIBaseResult::exec(), QDB2Result::exec(), QOCIResult::exec(), QSymSQLResult::exec(), QODBCResult::exec(), QOCICols::execBatch(), QDB2Result::fetch(), QSymSQLResult::fetch(), QPSQLResult::fetch(), QMYSQLResult::fetch(), QSqlCachedResult::fetch(), QODBCResult::fetch(), QDB2Result::fetchFirst(), QSqlCachedResult::fetchFirst(), QODBCResult::fetchFirst(), QDB2Result::fetchLast(), QSymSQLResult::fetchLast(), QSqlCachedResult::fetchLast(), QODBCResult::fetchLast(), QDB2Result::fetchNext(), QSymSQLResult::fetchNext(), QMYSQLResult::fetchNext(), QSqlCachedResult::fetchNext(), QODBCResult::fetchNext(), QSQLite2ResultPrivate::fetchNext(), QSQLiteResultPrivate::fetchNext(), QSymSQLResultPrivate::fetchNext(), QODBCResult::fetchPrevious(), QIBaseResult::gotoNext(), QOCIResult::gotoNext(), QTDSResult::gotoNext(), QDB2Result::nextResult(), QMYSQLResult::nextResult(), QODBCResult::nextResult(), QIBaseResult::prepare(), QDB2Result::prepare(), QODBCResult::prepare(), QDB2Result::reset(), QMYSQLResult::reset(), QTDSResult::reset(), QODBCResult::reset(), and QMYSQLResult::virtual_hook().

353 {
354  d->idx = index;
355 }
QSqlResultPrivate * d
Definition: qsqlresult.h:142
quint16 index

◆ setForwardOnly()

void QSqlResult::setForwardOnly ( bool  forward)
protectedvirtual

Sets forward only mode to forward.

If forward is true, only fetchNext() is allowed for navigating the results. Forward only mode needs much less memory since results do not have to be cached. By default, this feature is disabled.

Setting forward only to false is a suggestion to the database engine, which has the final say on whether a result set is forward only or scrollable. isForwardOnly() will always return the correct status of the result set.

Note
Calling setForwardOnly after execution of the query will result in unexpected results at best, and crashes at worst.
See also
isForwardOnly(), fetchNext(), QSqlQuery::setForwardOnly()

Reimplemented in QODBCResult, and QSqlNullResult.

Definition at line 603 of file qsqlresult.cpp.

Referenced by QODBCResult::exec(), QODBCResult::reset(), and QODBCResult::setForwardOnly().

604 {
605  d->forwardOnly = forward;
606 }
QSqlResultPrivate * d
Definition: qsqlresult.h:142

◆ setLastError()

void QSqlResult::setLastError ( const QSqlError error)
protectedvirtual

◆ setNumericalPrecisionPolicy()

void QSqlResult::setNumericalPrecisionPolicy ( QSql::NumericalPrecisionPolicy  policy)
protected
Warning
This function is not part of the public interface.

Definition at line 1029 of file qsqlresult.cpp.

1030 {
1031  d->precisionPolicy = policy;
1033 }
QSqlResultPrivate * d
Definition: qsqlresult.h:142
virtual void virtual_hook(int id, void *data)
Definition: qsqlresult.cpp:962
QSql::NumericalPrecisionPolicy precisionPolicy
Definition: qsqlresult.cpp:109

◆ setQuery()

void QSqlResult::setQuery ( const QString query)
protectedvirtual

Sets the current query for the result to query.

You must call reset() to execute the query on the database.

See also
reset(), lastQuery()

Reimplemented in QSqlNullResult.

Definition at line 282 of file qsqlresult.cpp.

283 {
284  d->sql = query;
285 }
QSqlResultPrivate * d
Definition: qsqlresult.h:142

◆ setSelect()

void QSqlResult::setSelect ( bool  select)
protectedvirtual

This function is provided for derived classes to indicate whether or not the current statement is a SQL SELECT statement.

The select parameter should be true if the statement is a SELECT statement; otherwise it should be false.

See also
isSelect()

Reimplemented in QSqlNullResult.

Definition at line 367 of file qsqlresult.cpp.

Referenced by QDB2Result::exec(), QOCIResult::exec(), QSQLiteResult::exec(), QSymSQLResult::exec(), QODBCResult::exec(), QOCICols::execBatch(), QDB2Result::nextResult(), QMYSQLResult::nextResult(), QODBCResult::nextResult(), QIBaseResult::prepare(), QSQLiteResult::prepare(), QSymSQLResult::prepare(), QDB2Result::reset(), QSQLite2Result::reset(), QMYSQLResult::reset(), QTDSResult::reset(), QODBCResult::reset(), and QMYSQLResult::virtual_hook().

368 {
369  d->isSel = select;
370 }
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *)
QSqlResultPrivate * d
Definition: qsqlresult.h:142

◆ size()

int QSqlResult::size ( )
protectedpure virtual

Returns the size of the SELECT result, or -1 if it cannot be determined or if the query is not a SELECT statement.

See also
numRowsAffected()

Implemented in QODBCResult, QTDSResult, QMYSQLResult, QSymSQLResult, QPSQLResult, QOCIResult, QDB2Result, QSQLiteResult, QSQLite2Result, QSqlNullResult, and QIBaseResult.

◆ virtual_hook()

void QSqlResult::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Friends and Related Functions

◆ QSqlQuery

friend class QSqlQuery
friend

Definition at line 65 of file qsqlresult.h.

◆ QSqlResultPrivate

friend class QSqlResultPrivate
friend

Definition at line 67 of file qsqlresult.h.

◆ QSqlTableModelPrivate

Definition at line 66 of file qsqlresult.h.

Properties

◆ d

QSqlResultPrivate* QSqlResult::d
private

Definition at line 142 of file qsqlresult.h.


The documentation for this class was generated from the following files: