summaryrefslogtreecommitdiffstats
path: root/src/sql/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/sql/kernel')
-rw-r--r--src/sql/kernel/qsql.qdoc2
-rw-r--r--src/sql/kernel/qsqldatabase.cpp60
-rw-r--r--src/sql/kernel/qsqldriver.cpp42
-rw-r--r--src/sql/kernel/qsqlerror.cpp12
-rw-r--r--src/sql/kernel/qsqlfield.cpp59
-rw-r--r--src/sql/kernel/qsqlquery.cpp69
-rw-r--r--src/sql/kernel/qsqlrecord.cpp20
-rw-r--r--src/sql/kernel/qsqlresult.cpp6
8 files changed, 118 insertions, 152 deletions
diff --git a/src/sql/kernel/qsql.qdoc b/src/sql/kernel/qsql.qdoc
index 394c255b35..6fbfc0415d 100644
--- a/src/sql/kernel/qsql.qdoc
+++ b/src/sql/kernel/qsql.qdoc
@@ -35,7 +35,7 @@
\ingroup database
- \sa {QtSql Module}
+ \sa {Qt SQL Module}
*/
/*!
diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp
index d4633cea57..f44f475d6c 100644
--- a/src/sql/kernel/qsqldatabase.cpp
+++ b/src/sql/kernel/qsqldatabase.cpp
@@ -390,7 +390,7 @@ void QSqlDatabasePrivate::disable()
snippet shows how to create and open a default connection to a
PostgreSQL database:
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 0
+ \snippet sqldatabase/sqldatabase.cpp 0
Once the QSqlDatabase object has been created, set the connection
parameters with setDatabaseName(), setUserName(), setPassword(),
@@ -403,7 +403,7 @@ void QSqlDatabasePrivate::disable()
{addDatabase()}. Subsequently, you can get the default connection
by calling database() without the connection name argument:
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 1
+ \snippet sqldatabase/sqldatabase.cpp 1
QSqlDatabase is a value class. Changes made to a database
connection via one instance of QSqlDatabase will affect other
@@ -440,7 +440,7 @@ void QSqlDatabasePrivate::disable()
If you have created your own custom driver, you must register it
with registerSqlDriver().
- \sa QSqlDriver, QSqlQuery, {QtSql Module}, {Threads and the SQL Module}
+ \sa QSqlDriver, QSqlQuery, {Qt SQL Module}, {Threads and the SQL Module}
*/
/*! \fn QSqlDatabase QSqlDatabase::addDatabase(const QString &type, const QString &connectionName)
@@ -472,7 +472,7 @@ void QSqlDatabasePrivate::disable()
setHostName(), setPort(), and setConnectOptions(), and, finally,
open().
- \sa database() removeDatabase() {Threads and the SQL Module}
+ \sa database(), removeDatabase(), {Threads and the SQL Module}
*/
QSqlDatabase QSqlDatabase::addDatabase(const QString &type, const QString &connectionName)
{
@@ -492,7 +492,7 @@ QSqlDatabase QSqlDatabase::addDatabase(const QString &type, const QString &conne
connectionName does not exist in the list of databases, an invalid
connection is returned.
- \sa isOpen() {Threads and the SQL Module}
+ \sa isOpen(), {Threads and the SQL Module}
*/
QSqlDatabase QSqlDatabase::database(const QString& connectionName, bool open)
@@ -512,11 +512,11 @@ QSqlDatabase QSqlDatabase::database(const QString& connectionName, bool open)
Example:
- \snippet doc/src/snippets/code/src_sql_kernel_qsqldatabase.cpp 0
+ \snippet code/src_sql_kernel_qsqldatabase.cpp 0
The correct way to do it:
- \snippet doc/src/snippets/code/src_sql_kernel_qsqldatabase.cpp 1
+ \snippet code/src_sql_kernel_qsqldatabase.cpp 1
To remove the default connection, which may have been created with a
call to addDatabase() not specifying a connection name, you can
@@ -524,7 +524,7 @@ QSqlDatabase QSqlDatabase::database(const QString& connectionName, bool open)
the database returned by database(). Note that if a default database
hasn't been created an invalid database will be returned.
- \sa database() connectionName() {Threads and the SQL Module}
+ \sa database(), connectionName(), {Threads and the SQL Module}
*/
void QSqlDatabase::removeDatabase(const QString& connectionName)
@@ -600,7 +600,7 @@ QStringList QSqlDatabase::drivers()
and don't want to compile it as a plugin.
Example:
- \snippet doc/src/snippets/code/src_sql_kernel_qsqldatabase.cpp 2
+ \snippet code/src_sql_kernel_qsqldatabase.cpp 2
QSqlDatabase takes ownership of the \a creator pointer, so you
mustn't delete it yourself.
@@ -831,8 +831,8 @@ QSqlQuery QSqlDatabase::exec(const QString & query) const
values. Returns true on success; otherwise returns false. Error
information can be retrieved using lastError().
- \sa lastError() setDatabaseName() setUserName() setPassword()
- \sa setHostName() setPort() setConnectOptions()
+ \sa lastError(), setDatabaseName(), setUserName(), setPassword(),
+ setHostName(), setPort(), setConnectOptions()
*/
bool QSqlDatabase::open()
@@ -924,7 +924,7 @@ bool QSqlDatabase::transaction()
Call lastError() to get information about errors.
- \sa QSqlQuery::isActive() QSqlDriver::hasFeature() rollback()
+ \sa QSqlQuery::isActive(), QSqlDriver::hasFeature(), rollback()
*/
bool QSqlDatabase::commit()
{
@@ -945,7 +945,7 @@ bool QSqlDatabase::commit()
Call lastError() to get information about errors.
- \sa QSqlQuery::isActive() QSqlDriver::hasFeature() commit()
+ \sa QSqlQuery::isActive(), QSqlDriver::hasFeature(), commit()
*/
bool QSqlDatabase::rollback()
{
@@ -974,12 +974,12 @@ bool QSqlDatabase::rollback()
connection string to open an \c .mdb file directly, instead of
having to create a DSN entry in the ODBC manager:
- \snippet doc/src/snippets/code/src_sql_kernel_qsqldatabase.cpp 3
+ \snippet code/src_sql_kernel_qsqldatabase.cpp 3
There is no default value.
- \sa databaseName() setUserName() setPassword() setHostName()
- \sa setPort() setConnectOptions() open()
+ \sa databaseName(), setUserName(), setPassword(), setHostName(),
+ setPort(), setConnectOptions(), open()
*/
void QSqlDatabase::setDatabaseName(const QString& name)
@@ -996,8 +996,8 @@ void QSqlDatabase::setDatabaseName(const QString& name)
There is no default value.
- \sa userName() setDatabaseName() setPassword() setHostName()
- \sa setPort() setConnectOptions() open()
+ \sa userName(), setDatabaseName(), setPassword(), setHostName(),
+ setPort(), setConnectOptions(), open()
*/
void QSqlDatabase::setUserName(const QString& name)
@@ -1018,8 +1018,8 @@ void QSqlDatabase::setUserName(const QString& name)
Qt. Use the open() call that takes a password as parameter to
avoid this behavior.
- \sa password() setUserName() setDatabaseName() setHostName()
- \sa setPort() setConnectOptions() open()
+ \sa password(), setUserName(), setDatabaseName(), setHostName(),
+ setPort(), setConnectOptions(), open()
*/
void QSqlDatabase::setPassword(const QString& password)
@@ -1036,8 +1036,8 @@ void QSqlDatabase::setPassword(const QString& password)
There is no default value.
- \sa hostName() setUserName() setPassword() setDatabaseName()
- \sa setPort() setConnectOptions() open()
+ \sa hostName(), setUserName(), setPassword(), setDatabaseName(),
+ setPort(), setConnectOptions(), open()
*/
void QSqlDatabase::setHostName(const QString& host)
@@ -1054,8 +1054,8 @@ void QSqlDatabase::setHostName(const QString& host)
There is no default value.
- \sa port() setUserName() setPassword() setHostName()
- \sa setDatabaseName() setConnectOptions() open()
+ \sa port(), setUserName(), setPassword(), setHostName(),
+ setDatabaseName(), setConnectOptions(), open()
*/
void QSqlDatabase::setPort(int port)
@@ -1130,7 +1130,7 @@ int QSqlDatabase::port() const
Returns the database driver used to access the database
connection.
- \sa addDatabase() drivers()
+ \sa addDatabase(), drivers()
*/
QSqlDriver* QSqlDatabase::driver() const
@@ -1278,7 +1278,7 @@ QSqlRecord QSqlDatabase::record(const QString& tablename) const
\endtable
Examples:
- \snippet doc/src/snippets/code/src_sql_kernel_qsqldatabase.cpp 4
+ \snippet code/src_sql_kernel_qsqldatabase.cpp 4
Refer to the client library documentation for more information
about the different options.
@@ -1325,9 +1325,9 @@ bool QSqlDatabase::isDriverAvailable(const QString& name)
application. For example, you can create a PostgreSQL connection
with your own QPSQL driver like this:
- \snippet doc/src/snippets/code/src_sql_kernel_qsqldatabase.cpp 5
+ \snippet code/src_sql_kernel_qsqldatabase.cpp 5
\codeline
- \snippet doc/src/snippets/code/src_sql_kernel_qsqldatabase.cpp 6
+ \snippet code/src_sql_kernel_qsqldatabase.cpp 6
The above code sets up a PostgreSQL connection and instantiates a
QPSQLDriver object. Next, addDatabase() is called to add the
@@ -1346,7 +1346,7 @@ bool QSqlDatabase::isDriverAvailable(const QString& name)
client library. Make sure the client library is in your linker's
search path, and add lines like these to your \c{.pro} file:
- \snippet doc/src/snippets/code/src_sql_kernel_qsqldatabase.cpp 7
+ \snippet code/src_sql_kernel_qsqldatabase.cpp 7
The method described works for all the supplied drivers. The only
difference will be in the driver constructor arguments. Here is a
@@ -1423,7 +1423,7 @@ QSqlDatabase QSqlDatabase::addDatabase(QSqlDriver* driver, const QString& connec
Returns true if the QSqlDatabase has a valid driver.
Example:
- \snippet doc/src/snippets/code/src_sql_kernel_qsqldatabase.cpp 8
+ \snippet code/src_sql_kernel_qsqldatabase.cpp 8
*/
bool QSqlDatabase::isValid() const
{
diff --git a/src/sql/kernel/qsqldriver.cpp b/src/sql/kernel/qsqldriver.cpp
index f48673f28f..284ef84f2d 100644
--- a/src/sql/kernel/qsqldriver.cpp
+++ b/src/sql/kernel/qsqldriver.cpp
@@ -133,7 +133,7 @@ QSqlDriver::~QSqlDriver()
/*!
\since 5.0
- \fn QSqlDriver::notification(const QString &name, NotificationSource source, const QString & payload)
+ \fn QSqlDriver::notification(const QString &name, QSqlDriver::NotificationSource source, const QVariant & payload)
This signal is emitted when the database posts an event notification
that the driver subscribes to. \a name identifies the event notification, \a source indicates the signal source,
@@ -682,11 +682,11 @@ QString QSqlDriver::formatValue(const QSqlField &field, bool trimStrings) const
This example retrieves the handle for a connection to sqlite:
- \snippet doc/src/snippets/code/src_sql_kernel_qsqldriver.cpp 0
+ \snippet code/src_sql_kernel_qsqldriver.cpp 0
This snippet returns the handle for PostgreSQL or MySQL:
- \snippet doc/src/snippets/code/src_sql_kernel_qsqldriver.cpp 1
+ \snippet code/src_sql_kernel_qsqldriver.cpp 1
\sa QSqlResult::handle()
*/
@@ -696,36 +696,6 @@ QVariant QSqlDriver::handle() const
}
/*!
- \fn QSqlRecord QSqlDriver::record(const QSqlQuery& query) const
-
- Use query.record() instead.
-*/
-
-/*!
- \fn QSqlRecord QSqlDriver::recordInfo(const QString& tablename) const
-
- Use record() instead.
-*/
-
-/*!
- \fn QSqlRecord QSqlDriver::recordInfo(const QSqlQuery& query) const
-
- Use query.record() instead.
-*/
-
-/*!
- \fn QString QSqlDriver::nullText() const
-
- sqlStatement() is now used to generate SQL. Use tr("NULL") for example, instead.
-*/
-
-/*!
- \fn QString QSqlDriver::formatValue(const QSqlField *field, bool trimStrings) const
-
- Use the other formatValue() overload instead.
-*/
-
-/*!
This function is called to subscribe to event notifications from the database.
\a name identifies the event notification.
@@ -743,7 +713,7 @@ QVariant QSqlDriver::handle() const
own QSqlDriver subclass,
\since 4.4
- \sa unsubscribeFromNotification() subscribedToNotifications() QSqlDriver::hasFeature()
+ \sa unsubscribeFromNotification(), subscribedToNotifications(), QSqlDriver::hasFeature()
*/
bool QSqlDriver::subscribeToNotification(const QString &name)
{
@@ -767,7 +737,7 @@ bool QSqlDriver::subscribeToNotification(const QString &name)
own QSqlDriver subclass,
\since 4.4
- \sa subscribeToNotification() subscribedToNotifications()
+ \sa subscribeToNotification(), subscribedToNotifications()
*/
bool QSqlDriver::unsubscribeFromNotification(const QString &name)
{
@@ -782,7 +752,7 @@ bool QSqlDriver::unsubscribeFromNotification(const QString &name)
own QSqlDriver subclass,
\since 4.4
- \sa subscribeToNotification() unsubscribeFromNotification()
+ \sa subscribeToNotification(), unsubscribeFromNotification()
*/
QStringList QSqlDriver::subscribedToNotifications() const
{
diff --git a/src/sql/kernel/qsqlerror.cpp b/src/sql/kernel/qsqlerror.cpp
index 79c7ee02c2..c1314a15a5 100644
--- a/src/sql/kernel/qsqlerror.cpp
+++ b/src/sql/kernel/qsqlerror.cpp
@@ -155,7 +155,7 @@ QSqlError::~QSqlError()
Returns the text of the error as reported by the driver. This may
contain database-specific descriptions. It may also be empty.
- \sa setDriverText() databaseText() text()
+ \sa setDriverText(), databaseText(), text()
*/
QString QSqlError::driverText() const
{
@@ -165,7 +165,7 @@ QString QSqlError::driverText() const
/*!
Sets the driver error text to the value of \a driverText.
- \sa driverText() setDatabaseText() text()
+ \sa driverText(), setDatabaseText(), text()
*/
void QSqlError::setDriverText(const QString& driverText)
@@ -177,7 +177,7 @@ void QSqlError::setDriverText(const QString& driverText)
Returns the text of the error as reported by the database. This
may contain database-specific descriptions; it may be empty.
- \sa setDatabaseText() driverText() text()
+ \sa setDatabaseText(), driverText(), text()
*/
QString QSqlError::databaseText() const
@@ -188,7 +188,7 @@ QString QSqlError::databaseText() const
/*!
Sets the database error text to the value of \a databaseText.
- \sa databaseText() setDriverText() text()
+ \sa databaseText(), setDriverText(), text()
*/
void QSqlError::setDatabaseText(const QString& databaseText)
@@ -245,7 +245,7 @@ void QSqlError::setNumber(int number)
This is a convenience function that returns databaseText() and
driverText() concatenated into a single string.
- \sa driverText() databaseText()
+ \sa driverText(), databaseText()
*/
QString QSqlError::text() const
@@ -261,7 +261,7 @@ QString QSqlError::text() const
Returns true if an error is set, otherwise false.
Example:
- \snippet doc/src/snippets/code/src_sql_kernel_qsqlerror.cpp 0
+ \snippet code/src_sql_kernel_qsqlerror.cpp 0
\sa type()
*/
diff --git a/src/sql/kernel/qsqlfield.cpp b/src/sql/kernel/qsqlfield.cpp
index 3160d25ef5..47162afb47 100644
--- a/src/sql/kernel/qsqlfield.cpp
+++ b/src/sql/kernel/qsqlfield.cpp
@@ -113,21 +113,21 @@ public:
Field data values are stored as QVariants. Using an incompatible
type is not permitted. For example:
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 2
+ \snippet sqldatabase/sqldatabase.cpp 2
However, the field will attempt to cast certain data types to the
field data type where possible:
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 3
+ \snippet sqldatabase/sqldatabase.cpp 3
QSqlField objects are rarely created explicitly in application
code. They are usually accessed indirectly through \l{QSqlRecord}s
that already contain a list of fields. For example:
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 4
+ \snippet sqldatabase/sqldatabase.cpp 4
\dots
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 5
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 6
+ \snippet sqldatabase/sqldatabase.cpp 5
+ \snippet sqldatabase/sqldatabase.cpp 6
A QSqlField object can provide some meta-data about the field, for
example, its name(), variant type(), length(), precision(),
@@ -157,7 +157,8 @@ public:
Constructs an empty field called \a fieldName of variant type \a
type.
- \sa setRequiredStatus() setLength() setPrecision() setDefaultValue() setGenerated() setReadOnly()
+ \sa setRequiredStatus(), setLength(), setPrecision(), setDefaultValue(),
+ setGenerated(), setReadOnly()
*/
QSqlField::QSqlField(const QString& fieldName, QVariant::Type type)
{
@@ -216,7 +217,8 @@ QSqlField::~QSqlField()
/*!
Sets the required status of this field to \a required.
- \sa requiredStatus() setType() setLength() setPrecision() setDefaultValue() setGenerated() setReadOnly()
+ \sa requiredStatus(), setType(), setLength(), setPrecision(),
+ setDefaultValue(), setGenerated(), setReadOnly()
*/
void QSqlField::setRequiredStatus(RequiredStatus required)
{
@@ -237,7 +239,8 @@ void QSqlField::setRequiredStatus(RequiredStatus required)
maximum number of characters the string can hold; the meaning
varies for other types.
- \sa length() setType() setRequiredStatus() setPrecision() setDefaultValue() setGenerated() setReadOnly()
+ \sa length(), setType(), setRequiredStatus(), setPrecision(),
+ setDefaultValue(), setGenerated(), setReadOnly()
*/
void QSqlField::setLength(int fieldLength)
{
@@ -248,7 +251,8 @@ void QSqlField::setLength(int fieldLength)
/*!
Sets the field's \a precision. This only affects numeric fields.
- \sa precision() setType() setRequiredStatus() setLength() setDefaultValue() setGenerated() setReadOnly()
+ \sa precision(), setType(), setRequiredStatus(), setLength(),
+ setDefaultValue(), setGenerated(), setReadOnly()
*/
void QSqlField::setPrecision(int precision)
{
@@ -259,7 +263,8 @@ void QSqlField::setPrecision(int precision)
/*!
Sets the default value used for this field to \a value.
- \sa defaultValue() value() setType() setRequiredStatus() setLength() setPrecision() setGenerated() setReadOnly()
+ \sa defaultValue(), value(), setType(), setRequiredStatus(),
+ setLength(), setPrecision(), setGenerated(), setReadOnly()
*/
void QSqlField::setDefaultValue(const QVariant &value)
{
@@ -282,7 +287,8 @@ void QSqlField::setSqlType(int type)
QSqlQueryModel and QSqlTableModel will generate SQL for this
field.
- \sa isGenerated() setType() setRequiredStatus() setLength() setPrecision() setDefaultValue() setReadOnly()
+ \sa isGenerated(), setType(), setRequiredStatus(), setLength(),
+ setPrecision(), setDefaultValue(), setReadOnly()
*/
void QSqlField::setGenerated(bool gen)
{
@@ -302,7 +308,7 @@ void QSqlField::setGenerated(bool gen)
To set the value to NULL, use clear().
- \sa value() isReadOnly() defaultValue()
+ \sa value(), isReadOnly(), defaultValue()
*/
void QSqlField::setValue(const QVariant& value)
@@ -316,7 +322,7 @@ void QSqlField::setValue(const QVariant& value)
Clears the value of the field and sets it to NULL.
If the field is read-only, nothing happens.
- \sa setValue() isReadOnly() requiredStatus()
+ \sa setValue(), isReadOnly(), requiredStatus()
*/
void QSqlField::clear()
@@ -384,7 +390,8 @@ QVariant::Type QSqlField::type() const
/*!
Set's the field's variant type to \a type.
- \sa type() setRequiredStatus() setLength() setPrecision() setDefaultValue() setGenerated() setReadOnly()
+ \sa type(), setRequiredStatus(), setLength(), setPrecision(),
+ setDefaultValue(), setGenerated(), setReadOnly()
*/
void QSqlField::setType(QVariant::Type type)
{
@@ -399,7 +406,8 @@ void QSqlField::setType(QVariant::Type type)
Returns true if the field's value is read-only; otherwise returns
false.
- \sa setReadOnly() type() requiredStatus() length() precision() defaultValue() isGenerated()
+ \sa setReadOnly(), type(), requiredStatus(), length(), precision(),
+ defaultValue(), isGenerated()
*/
bool QSqlField::isReadOnly() const
{ return d->ro; }
@@ -424,7 +432,8 @@ void QSqlField::detach()
Returns true if this is a required field; otherwise returns false.
An \c INSERT will fail if a required field does not have a value.
- \sa setRequiredStatus() type() length() precision() defaultValue() isGenerated()
+ \sa setRequiredStatus(), type(), length(), precision(), defaultValue(),
+ isGenerated()
*/
QSqlField::RequiredStatus QSqlField::requiredStatus() const
{
@@ -437,7 +446,8 @@ QSqlField::RequiredStatus QSqlField::requiredStatus() const
If the returned value is negative, it means that the information
is not available from the database.
- \sa setLength() type() requiredStatus() precision() defaultValue() isGenerated()
+ \sa setLength(), type(), requiredStatus(), precision(), defaultValue(),
+ isGenerated()
*/
int QSqlField::length() const
{
@@ -451,7 +461,8 @@ int QSqlField::length() const
If the returned value is negative, it means that the information
is not available from the database.
- \sa setPrecision() type() requiredStatus() length() defaultValue() isGenerated()
+ \sa setPrecision(), type(), requiredStatus(), length(), defaultValue(),
+ isGenerated()
*/
int QSqlField::precision() const
{
@@ -461,7 +472,8 @@ int QSqlField::precision() const
/*!
Returns the field's default value (which may be NULL).
- \sa setDefaultValue() type() requiredStatus() length() precision() isGenerated()
+ \sa setDefaultValue(), type(), requiredStatus(), length(), precision(),
+ isGenerated()
*/
QVariant QSqlField::defaultValue() const
{
@@ -485,7 +497,8 @@ int QSqlField::typeID() const
Returns true if the field is generated; otherwise returns
false.
- \sa setGenerated() type() requiredStatus() length() precision() defaultValue()
+ \sa setGenerated(), type(), requiredStatus(), length(), precision(),
+ defaultValue()
*/
bool QSqlField::isGenerated() const
{
@@ -523,12 +536,6 @@ QDebug operator<<(QDebug dbg, const QSqlField &f)
#endif
/*!
- \fn void QSqlField::setNull()
-
- Use clear() instead.
-*/
-
-/*!
Returns true if the value is auto-generated by the database,
for example auto-increment primary key values.
diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp
index e21a8f4956..78631b5e5f 100644
--- a/src/sql/kernel/qsqlquery.cpp
+++ b/src/sql/kernel/qsqlquery.cpp
@@ -148,7 +148,7 @@ QSqlQueryPrivate::~QSqlQueryPrivate()
For example:
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 7
+ \snippet sqldatabase/sqldatabase.cpp 7
To access the data returned by a query, use value(int). Each
field in the data returned by a \c SELECT statement is accessed
@@ -161,7 +161,7 @@ QSqlQueryPrivate::~QSqlQueryPrivate()
explained below). To convert a field name into an index, use
record().\l{QSqlRecord::indexOf()}{indexOf()}, for example:
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 8
+ \snippet sqldatabase/sqldatabase.cpp 8
QSqlQuery supports prepared query execution and the binding of
parameter values to placeholders. Some databases don't support
@@ -190,19 +190,19 @@ QSqlQueryPrivate::~QSqlQueryPrivate()
\b{Named binding using named placeholders:}
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 9
+ \snippet sqldatabase/sqldatabase.cpp 9
\b{Positional binding using named placeholders:}
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 10
+ \snippet sqldatabase/sqldatabase.cpp 10
\b{Binding values using positional placeholders (version 1):}
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 11
+ \snippet sqldatabase/sqldatabase.cpp 11
\b{Binding values using positional placeholders (version 2):}
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 12
+ \snippet sqldatabase/sqldatabase.cpp 12
\b{Binding values to a stored procedure:}
@@ -210,7 +210,7 @@ QSqlQueryPrivate::~QSqlQueryPrivate()
it a character through its in parameter, and taking its result in
the out parameter.
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 13
+ \snippet sqldatabase/sqldatabase.cpp 13
Note that unbound parameters will retain their values.
@@ -343,7 +343,7 @@ bool QSqlQuery::isNull(int field) const
Example:
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 34
+ \snippet sqldatabase/sqldatabase.cpp 34
\sa isActive(), isValid(), next(), previous(), first(), last(),
seek()
@@ -384,7 +384,7 @@ bool QSqlQuery::exec(const QString& query)
The fields are numbered from left to right using the text of the
\c SELECT statement, e.g. in
- \snippet doc/src/snippets/code/src_sql_kernel_qsqlquery.cpp 0
+ \snippet code/src_sql_kernel_qsqlquery.cpp 0
field 0 is \c forename and field 1 is \c
surname. Using \c{SELECT *} is not recommended because the order
@@ -394,7 +394,7 @@ bool QSqlQuery::exec(const QString& query)
exist, if the query is inactive, or if the query is positioned on
an invalid record.
- \sa previous() next() first() last() seek() isActive() isValid()
+ \sa previous(), next(), first(), last(), seek(), isActive(), isValid()
*/
QVariant QSqlQuery::value(int index) const
@@ -411,7 +411,7 @@ QVariant QSqlQuery::value(int index) const
function returns QSql::BeforeFirstRow or
QSql::AfterLastRow, which are special negative values.
- \sa previous() next() first() last() seek() isActive() isValid()
+ \sa previous(), next(), first(), last(), seek(), isActive(), isValid()
*/
int QSqlQuery::at() const
@@ -495,7 +495,7 @@ const QSqlResult* QSqlQuery::result() const
\endlist
- \sa next() previous() first() last() at() isActive() isValid()
+ \sa next(), previous(), first(), last(), at(), isActive(), isValid()
*/
bool QSqlQuery::seek(int index, bool relative)
{
@@ -587,7 +587,7 @@ bool QSqlQuery::seek(int index, bool relative)
the last record and false is returned. If the record is successfully
retrieved, true is returned.
- \sa previous() first() last() seek() at() isActive() isValid()
+ \sa previous(), first(), last(), seek(), at(), isActive(), isValid()
*/
bool QSqlQuery::next()
{
@@ -636,7 +636,7 @@ bool QSqlQuery::next()
before the first record and false is returned. If the record is
successfully retrieved, true is returned.
- \sa next() first() last() seek() at() isActive() isValid()
+ \sa next(), first(), last(), seek(), at(), isActive(), isValid()
*/
bool QSqlQuery::previous()
{
@@ -671,7 +671,7 @@ bool QSqlQuery::previous()
return false. Returns true if successful. If unsuccessful the query
position is set to an invalid position and false is returned.
- \sa next() previous() last() seek() at() isActive() isValid()
+ \sa next(), previous(), last(), seek(), at(), isActive(), isValid()
*/
bool QSqlQuery::first()
{
@@ -695,7 +695,7 @@ bool QSqlQuery::first()
Returns true if successful. If unsuccessful the query position is
set to an invalid position and false is returned.
- \sa next() previous() first() seek() at() isActive() isValid()
+ \sa next(), previous(), first(), seek(), at(), isActive(), isValid()
*/
bool QSqlQuery::last()
@@ -717,7 +717,7 @@ bool QSqlQuery::last()
To determine the number of rows affected by a non-\c SELECT
statement, use numRowsAffected().
- \sa isActive() numRowsAffected() QSqlDriver::hasFeature()
+ \sa isActive(), numRowsAffected(), QSqlDriver::hasFeature()
*/
int QSqlQuery::size() const
{
@@ -732,7 +732,7 @@ int QSqlQuery::size() const
statements, the value is undefined; use size() instead. If the query
is not \l{isActive()}{active}, -1 is returned.
- \sa size() QSqlDriver::hasFeature()
+ \sa size(), QSqlDriver::hasFeature()
*/
int QSqlQuery::numRowsAffected() const
@@ -850,7 +850,7 @@ void QSqlQuery::setForwardOnly(bool forward)
Since the order of the columns is not defined, QSqlRecord::indexOf()
is used to obtain the index of a column.
- \snippet doc/src/snippets/code/src_sql_kernel_qsqlquery.cpp 1
+ \snippet code/src_sql_kernel_qsqlquery.cpp 1
\sa value()
*/
@@ -895,7 +895,7 @@ void QSqlQuery::clear()
Example:
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 9
+ \snippet sqldatabase/sqldatabase.cpp 9
\sa exec(), bindValue(), addBindValue()
*/
@@ -937,7 +937,7 @@ bool QSqlQuery::prepare(const QString& query)
Note that the last error for this query is reset when exec() is
called.
- \sa prepare() bindValue() addBindValue() boundValue() boundValues()
+ \sa prepare(), bindValue(), addBindValue(), boundValue(), boundValues()
*/
bool QSqlQuery::exec()
{
@@ -968,11 +968,11 @@ bool QSqlQuery::exec()
Example:
- \snippet doc/src/snippets/code/src_sql_kernel_qsqlquery.cpp 2
+ \snippet code/src_sql_kernel_qsqlquery.cpp 2
The example above inserts four new rows into \c myTable:
- \snippet doc/src/snippets/code/src_sql_kernel_qsqlquery.cpp 3
+ \snippet code/src_sql_kernel_qsqlquery.cpp 3
To bind NULL values, a null QVariant of the relevant type has to be
added to the bound QVariantList; for example, \c
@@ -1021,7 +1021,7 @@ bool QSqlQuery::execBatch(BatchExecutionMode mode)
\endcode
Binding to name will bind to the first :name, but not the second.
- \sa addBindValue(), prepare(), exec(), boundValue() boundValues()
+ \sa addBindValue(), prepare(), exec(), boundValue(), boundValues()
*/
void QSqlQuery::bindValue(const QString& placeholder, const QVariant& val,
QSql::ParamType paramType
@@ -1051,7 +1051,7 @@ void QSqlQuery::bindValue(int pos, const QVariant& val, QSql::ParamType paramTyp
To bind a NULL value, use a null QVariant; for example, use \c
{QVariant(QVariant::String)} if you are binding a string.
- \sa bindValue(), prepare(), exec(), boundValue() boundValues()
+ \sa bindValue(), prepare(), exec(), boundValue(), boundValues()
*/
void QSqlQuery::addBindValue(const QVariant& val, QSql::ParamType paramType)
{
@@ -1061,7 +1061,7 @@ void QSqlQuery::addBindValue(const QVariant& val, QSql::ParamType paramType)
/*!
Returns the value for the \a placeholder.
- \sa boundValues() bindValue() addBindValue()
+ \sa boundValues(), bindValue(), addBindValue()
*/
QVariant QSqlQuery::boundValue(const QString& placeholder) const
{
@@ -1082,13 +1082,13 @@ QVariant QSqlQuery::boundValue(int pos) const
With named binding, the bound values can be examined in the
following ways:
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 14
+ \snippet sqldatabase/sqldatabase.cpp 14
With positional binding, the code becomes:
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 15
+ \snippet sqldatabase/sqldatabase.cpp 15
- \sa boundValue() bindValue() addBindValue()
+ \sa boundValue(), bindValue(), addBindValue()
*/
QMap<QString,QVariant> QSqlQuery::boundValues() const
{
@@ -1118,12 +1118,6 @@ QString QSqlQuery::executedQuery() const
}
/*!
- \fn bool QSqlQuery::prev()
-
- Use previous() instead.
-*/
-
-/*!
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
@@ -1190,7 +1184,7 @@ QSql::NumericalPrecisionPolicy QSqlQuery::numericalPrecisionPolicy() const
Sets the query to inactive. Bound values retain their values.
- \sa prepare() exec() isActive()
+ \sa prepare(), exec(), isActive()
*/
void QSqlQuery::finish()
{
@@ -1230,7 +1224,8 @@ void QSqlQuery::finish()
databases may have restrictions on which statements are allowed to
be used in a SQL batch.
- \sa QSqlDriver::hasFeature() setForwardOnly() next() isSelect() numRowsAffected() isActive() lastError()
+ \sa QSqlDriver::hasFeature(), setForwardOnly(), next(), isSelect(),
+ numRowsAffected(), isActive(), lastError()
*/
bool QSqlQuery::nextResult()
{
diff --git a/src/sql/kernel/qsqlrecord.cpp b/src/sql/kernel/qsqlrecord.cpp
index 93ef58914b..4349661835 100644
--- a/src/sql/kernel/qsqlrecord.cpp
+++ b/src/sql/kernel/qsqlrecord.cpp
@@ -189,7 +189,7 @@ bool QSqlRecord::operator==(const QSqlRecord &other) const
the record. If \a index is out of bounds, an invalid QVariant
is returned.
- \sa fieldName() isNull()
+ \sa fieldName(), isNull()
*/
QVariant QSqlRecord::value(int index) const
@@ -264,7 +264,7 @@ QSqlField QSqlRecord::field(const QString &name) const
/*!
Append a copy of field \a field to the end of the record.
- \sa insert() replace() remove()
+ \sa insert(), replace(), remove()
*/
void QSqlRecord::append(const QSqlField& field)
@@ -276,7 +276,7 @@ void QSqlRecord::append(const QSqlField& field)
/*!
Inserts the field \a field at position \a pos in the record.
- \sa append() replace() remove()
+ \sa append(), replace(), remove()
*/
void QSqlRecord::insert(int pos, const QSqlField& field)
{
@@ -288,7 +288,7 @@ void QSqlRecord::insert(int pos, const QSqlField& field)
Replaces the field at position \a pos with the given \a field. If
\a pos is out of range, nothing happens.
- \sa append() insert() remove()
+ \sa append(), insert(), remove()
*/
void QSqlRecord::replace(int pos, const QSqlField& field)
@@ -304,7 +304,7 @@ void QSqlRecord::replace(int pos, const QSqlField& field)
Removes the field at position \a pos. If \a pos is out of range,
nothing happens.
- \sa append() insert() replace()
+ \sa append(), insert(), replace()
*/
void QSqlRecord::remove(int pos)
@@ -319,7 +319,7 @@ void QSqlRecord::remove(int pos)
/*!
Removes all the record's fields.
- \sa clearValues() isEmpty()
+ \sa clearValues(), isEmpty()
*/
void QSqlRecord::clear()
@@ -332,7 +332,7 @@ void QSqlRecord::clear()
Returns true if there are no fields in the record; otherwise
returns false.
- \sa append() insert() clear()
+ \sa append(), insert(), clear()
*/
bool QSqlRecord::isEmpty() const
@@ -524,10 +524,4 @@ QDebug operator<<(QDebug dbg, const QSqlRecord &r)
}
#endif
-/*!
- \fn int QSqlRecord::position(const QString& name) const
-
- Use indexOf() instead.
-*/
-
QT_END_NAMESPACE
diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp
index f9dbae306b..03e227bffc 100644
--- a/src/sql/kernel/qsqlresult.cpp
+++ b/src/sql/kernel/qsqlresult.cpp
@@ -953,7 +953,7 @@ void QSqlResult::virtual_hook(int, void *)
Example:
- \snippet doc/src/snippets/code/src_sql_kernel_qsqlresult.cpp 0
+ \snippet code/src_sql_kernel_qsqlresult.cpp 0
Here, we insert two rows into a SQL table, with each row containing three values.
@@ -1032,11 +1032,11 @@ bool QSqlResult::nextResult()
This example retrieves the handle for a sqlite result:
- \snippet doc/src/snippets/code/src_sql_kernel_qsqlresult.cpp 1
+ \snippet code/src_sql_kernel_qsqlresult.cpp 1
This snippet returns the handle for PostgreSQL or MySQL:
- \snippet doc/src/snippets/code/src_sql_kernel_qsqlresult.cpp 2
+ \snippet code/src_sql_kernel_qsqlresult.cpp 2
\sa QSqlDriver::handle()
*/