prepare QSqlResultPrivate() to allow subclassing
Allow the private class to be instantiated before the public class. Public subclasses will need to first instantiate the private subclass and pass the reference to QSqlResult. Add virtual constructor so QSqlResult can delete private class polymorphically. Change-Id: Ide7115dbb4150d6604677b542dbec16e6956a142 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
This commit is contained in:
parent
d28073d9eb
commit
8434b7ad4a
@ -218,11 +218,11 @@ QString QSqlResultPrivate::namedToPositionalBinding(const QString &query)
|
||||
|
||||
QSqlResult::QSqlResult(const QSqlDriver *db)
|
||||
{
|
||||
d = new QSqlResultPrivate(this);
|
||||
d = new QSqlResultPrivate;
|
||||
d->q = this;
|
||||
d->sqldriver = const_cast<QSqlDriver *>(db);
|
||||
if(db) {
|
||||
setNumericalPrecisionPolicy(db->numericalPrecisionPolicy());
|
||||
}
|
||||
if (d->sqldriver)
|
||||
setNumericalPrecisionPolicy(d->sqldriver->numericalPrecisionPolicy());
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -71,8 +71,8 @@ struct QHolder {
|
||||
class Q_SQL_EXPORT QSqlResultPrivate
|
||||
{
|
||||
public:
|
||||
QSqlResultPrivate(QSqlResult *d)
|
||||
: q(d),
|
||||
QSqlResultPrivate()
|
||||
: q(0),
|
||||
idx(QSql::BeforeFirstRow),
|
||||
active(false),
|
||||
isSel(false),
|
||||
@ -81,6 +81,7 @@ public:
|
||||
bindCount(0),
|
||||
binds(QSqlResult::PositionalBinding)
|
||||
{ }
|
||||
virtual ~QSqlResultPrivate() { }
|
||||
|
||||
void clearValues()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user