summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Goddard <michael.goddard@nokia.com>2010-11-04 05:47:51 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2011-02-08 12:32:34 (GMT)
commit940602ea5addefb7a3ef37be393de7ad64421e94 (patch)
tree63554a4a6f600feff3dbade79e228e35463a54a8
parentae323be1afd09b7ef7ed7c75e0edf1a7b3307497 (diff)
downloadQt-940602ea5addefb7a3ef37be393de7ad64421e94.zip
Qt-940602ea5addefb7a3ef37be393de7ad64421e94.tar.gz
Qt-940602ea5addefb7a3ef37be393de7ad64421e94.tar.bz2
Try to document that invalid database arguments use the default database.
Some places documented this, some didn't. Change-Id: Id66678dbcd9af6ec9687db745ba6f5506e951d1d Task-number: QTBUG-3240 Reviewed-by: Charles Yin (cherry picked from commit d300e8208928084b62bbde01fb81bd66bc967bc8)
-rw-r--r--src/sql/kernel/qsqlquery.cpp3
-rw-r--r--src/sql/models/qsqlquerymodel.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp
index 4b92a3e..3cdc8b1 100644
--- a/src/sql/kernel/qsqlquery.cpp
+++ b/src/sql/kernel/qsqlquery.cpp
@@ -272,7 +272,7 @@ static void qInit(QSqlQuery *q, const QString& query, QSqlDatabase db)
/*!
Constructs a QSqlQuery object using the SQL \a query and the
- database \a db. If \a db is not specified, the application's
+ database \a db. If \a db is not specified, or is invalid, the application's
default database is used. If \a query is not an empty string, it
will be executed.
@@ -286,6 +286,7 @@ QSqlQuery::QSqlQuery(const QString& query, QSqlDatabase db)
/*!
Constructs a QSqlQuery object using the database \a db.
+ If \a db is invalid, the application's default database will be used.
\sa QSqlDatabase
*/
diff --git a/src/sql/models/qsqlquerymodel.cpp b/src/sql/models/qsqlquerymodel.cpp
index 8730192..1ad11c3 100644
--- a/src/sql/models/qsqlquerymodel.cpp
+++ b/src/sql/models/qsqlquerymodel.cpp
@@ -370,7 +370,8 @@ void QSqlQueryModel::setQuery(const QSqlQuery &query)
/*! \overload
Executes the query \a query for the given database connection \a
- db. If no database is specified, the default connection is used.
+ db. If no database (or an invalid database) is specified, the
+ default connection is used.
lastError() can be used to retrieve verbose information if there
was an error setting the query.