Qt 4.8
Classes | Functions
qsqlquery.cpp File Reference
#include "qsqlquery.h"
#include "qatomic.h"
#include "qsqlrecord.h"
#include "qsqlresult.h"
#include "qsqldriver.h"
#include "qsqldatabase.h"
#include "private/qsqlnulldriver_p.h"
#include "qvector.h"
#include "qmap.h"

Go to the source code of this file.

Classes

class  QSqlQueryPrivate
 

Functions

 Q_GLOBAL_STATIC_WITH_ARGS (QSqlNullResult, nullResult,(nullDriver())) QSqlQueryPrivate *QSqlQueryPrivate
 
static void qInit (QSqlQuery *q, const QString &query, QSqlDatabase db)
 

Function Documentation

◆ Q_GLOBAL_STATIC_WITH_ARGS()

Q_GLOBAL_STATIC_WITH_ARGS ( QSqlNullResult  ,
nullResult  ,
(nullDriver())   
)

Definition at line 70 of file qsqlquery.cpp.

73 {
74  QSqlQueryPrivate *null = nullQueryPrivate();
75  null->ref.ref();
76  return null;
77 }
bool ref()
Atomically increments the value of this QAtomicInt.
QAtomicInt ref
Definition: qsqlquery.cpp:62

◆ qInit()

static void qInit ( QSqlQuery q,
const QString query,
QSqlDatabase  db 
)
static
Warning
This function is not part of the public interface.

Definition at line 264 of file qsqlquery.cpp.

Referenced by QSqlQuery::QSqlQuery().

265 {
266  QSqlDatabase database = db;
267  if (!database.isValid())
269  if (database.isValid()) {
270  *q = QSqlQuery(database.driver()->createResult());
271  }
272  if (!query.isEmpty())
273  q->exec(query);
274 }
bool isValid() const
Returns true if the QSqlDatabase has a valid driver.
The QSqlQuery class provides a means of executing and manipulating SQL statements.
Definition: qsqlquery.h:63
The QSqlDatabase class represents a connection to a database.
Definition: qsqldatabase.h:78
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QSqlDriver * driver() const
Returns the database driver used to access the database connection.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
static QSqlDatabase database(const QString &connectionName=QLatin1String(defaultConnection), bool open=true)
Returns the database connection called connectionName.
virtual QSqlResult * createResult() const =0
Creates an empty SQL result on the database.
QT_STATIC_CONST char * defaultConnection
Definition: qsqldatabase.h:128
bool exec(const QString &query)
Executes the SQL in query.
Definition: qsqlquery.cpp:355