QSqlDatabase: add Q_PROPERTY
Add Q_PROPERTY to follow the current Qt style and simplify the documentation. Task-number: QTBUG-120566 Change-Id: I23103a921cd391f24ce0ffd915a4ae2f98686d21 Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>bb10
parent
6be61763a0
commit
781135b0d2
|
|
@ -1292,8 +1292,11 @@ QString QSqlDatabase::connectionName() const
|
|||
}
|
||||
|
||||
/*!
|
||||
Sets the default numerical precision policy used by queries created
|
||||
on this database connection to \a precisionPolicy.
|
||||
\property QSqlDatabase::numericalPrecisionPolicy
|
||||
\since 6.8
|
||||
|
||||
This property holds the default numerical precision policy used by
|
||||
queries created on this database connection.
|
||||
|
||||
Note: Drivers that don't support fetching numerical values with low
|
||||
precision will ignore the precision policy. You can use
|
||||
|
|
@ -1303,9 +1306,12 @@ QString QSqlDatabase::connectionName() const
|
|||
Note: Setting the default precision policy to \a precisionPolicy
|
||||
doesn't affect any currently active queries.
|
||||
|
||||
\sa QSql::NumericalPrecisionPolicy, numericalPrecisionPolicy(),
|
||||
QSqlQuery::setNumericalPrecisionPolicy(), QSqlQuery::numericalPrecisionPolicy()
|
||||
\sa QSql::NumericalPrecisionPolicy, QSqlQuery::numericalPrecisionPolicy,
|
||||
QSqlDriver::numericalPrecisionPolicy
|
||||
*/
|
||||
/*!
|
||||
Sets \l numericalPrecisionPolicy to \a precisionPolicy.
|
||||
*/
|
||||
void QSqlDatabase::setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy)
|
||||
{
|
||||
if (driver())
|
||||
|
|
@ -1314,10 +1320,7 @@ void QSqlDatabase::setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy pr
|
|||
}
|
||||
|
||||
/*!
|
||||
Returns the current default precision policy for the database connection.
|
||||
|
||||
\sa QSql::NumericalPrecisionPolicy, setNumericalPrecisionPolicy(),
|
||||
QSqlQuery::numericalPrecisionPolicy(), QSqlQuery::setNumericalPrecisionPolicy()
|
||||
Returns the \l numericalPrecisionPolicy.
|
||||
*/
|
||||
QSql::NumericalPrecisionPolicy QSqlDatabase::numericalPrecisionPolicy() const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,8 +5,10 @@
|
|||
#define QSQLDATABASE_H
|
||||
|
||||
#include <QtSql/qtsqlglobal.h>
|
||||
#include <QtCore/qmetaobject.h>
|
||||
#include <QtCore/qstring.h>
|
||||
|
||||
// clazy:excludeall=qproperty-without-notify
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
|
|
@ -33,7 +35,10 @@ public:
|
|||
|
||||
class Q_SQL_EXPORT QSqlDatabase
|
||||
{
|
||||
Q_GADGET
|
||||
public:
|
||||
Q_PROPERTY(QSql::NumericalPrecisionPolicy numericalPrecisionPolicy READ numericalPrecisionPolicy WRITE setNumericalPrecisionPolicy)
|
||||
|
||||
QSqlDatabase();
|
||||
QSqlDatabase(const QSqlDatabase &other);
|
||||
~QSqlDatabase();
|
||||
|
|
|
|||
|
|
@ -739,8 +739,8 @@ void QSqlDriver::setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy prec
|
|||
This property holds the precision policy for the database connection.
|
||||
\note Setting the precision policy doesn't affect any currently active queries.
|
||||
|
||||
\sa QSql::NumericalPrecisionPolicy,
|
||||
QSqlQuery::numericalPrecisionPolicy(), QSqlQuery::setNumericalPrecisionPolicy()
|
||||
\sa QSql::NumericalPrecisionPolicy, QSqlQuery::numericalPrecisionPolicy,
|
||||
QSqlDatabase::numericalPrecisionPolicy
|
||||
*/
|
||||
/*!
|
||||
Returns the \l numericalPrecisionPolicy.
|
||||
|
|
|
|||
Loading…
Reference in New Issue