summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/compat/removed_api.cpp69
-rw-r--r--src/sql/kernel/qsqldatabase.cpp6
-rw-r--r--src/sql/kernel/qsqldatabase.h4
-rw-r--r--src/sql/kernel/qsqlquery.cpp22
-rw-r--r--src/sql/kernel/qsqlquery.h8
-rw-r--r--src/sql/kernel/qsqlrecord.cpp140
-rw-r--r--src/sql/kernel/qsqlrecord.h36
-rw-r--r--src/sql/models/qsqlquerymodel.cpp7
-rw-r--r--src/sql/models/qsqlrelationaltablemodel.cpp18
-rw-r--r--src/sql/models/qsqltablemodel.cpp33
-rw-r--r--src/sql/models/qsqltablemodel_p.h6
11 files changed, 173 insertions, 176 deletions
diff --git a/src/sql/compat/removed_api.cpp b/src/sql/compat/removed_api.cpp
index 9da60eceda..2c2b353a3f 100644
--- a/src/sql/compat/removed_api.cpp
+++ b/src/sql/compat/removed_api.cpp
@@ -50,3 +50,72 @@ QList<QVariant> &QSqlResult::boundValues() const
}
#endif // QT_SQL_REMOVED_SINCE(6, 6)
+
+#if QT_SQL_REMOVED_SINCE(6, 8)
+
+#include "qsqlrecord.h"
+#include "qsqlfield.h"
+
+// #include <qotherheader.h>
+// // implement removed functions from qotherheader.h
+// order sections alphabetically to reduce chances of merge conflicts
+
+bool QSqlRecord::contains(const QString &name) const
+{
+ return contains(QStringView(name));
+}
+
+QSqlField QSqlRecord::field(const QString &name) const
+{
+ return field(QStringView(name));
+}
+
+int QSqlRecord::indexOf(const QString &name) const
+{
+ return indexOf(QStringView(name));
+}
+
+bool QSqlRecord::isGenerated(const QString &name) const
+{
+ return isGenerated(QStringView(name));
+}
+
+bool QSqlRecord::isNull(const QString &name) const
+{
+ return isNull(QStringView(name));
+}
+
+void QSqlRecord::setGenerated(const QString &name, bool generated)
+{
+ setGenerated(QStringView(name), generated);
+}
+
+void QSqlRecord::setNull(const QString &name)
+{
+ setNull(QStringView(name));
+}
+
+void QSqlRecord::setValue(const QString &name, const QVariant &val)
+{
+ setValue(QStringView(name), val);
+}
+
+QVariant QSqlRecord::value(const QString &name) const
+{
+ return value(QStringView(name));
+}
+
+
+#include "qsqlquery.h"
+
+bool QSqlQuery::isNull(const QString &name) const
+{
+ return isNull(QStringView(name));
+}
+
+QVariant QSqlQuery::value(const QString &name) const
+{
+ return value(QStringView(name));
+}
+
+#endif // QT_SQL_REMOVED_SINCE(6, 8)
diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp
index fdbb16a589..e44533291a 100644
--- a/src/sql/kernel/qsqldatabase.cpp
+++ b/src/sql/kernel/qsqldatabase.cpp
@@ -18,7 +18,7 @@
QT_BEGIN_NAMESPACE
-static Q_LOGGING_CATEGORY(lcSqlDb, "qt.sql.qsqldatabase")
+Q_STATIC_LOGGING_CATEGORY(lcSqlDb, "qt.sql.qsqldatabase")
using namespace Qt::StringLiterals;
@@ -239,6 +239,8 @@ void QSqlDatabasePrivate::disable()
Destroys the SQL driver creator object.
*/
+QSqlDriverCreatorBase::~QSqlDriverCreatorBase()
+ = default;
/*!
\fn QSqlDriver *QSqlDriverCreatorBase::createObject() const
@@ -1375,7 +1377,7 @@ bool QSqlDatabase::moveToThread(QThread *targetThread)
Returns a pointer to the associated QThread instance.
*/
-QThread *QSqlDatabase::currentThread() const
+QThread *QSqlDatabase::thread() const
{
if (auto drv = driver())
return drv->thread();
diff --git a/src/sql/kernel/qsqldatabase.h b/src/sql/kernel/qsqldatabase.h
index 5059dbba83..85d6b4d9d9 100644
--- a/src/sql/kernel/qsqldatabase.h
+++ b/src/sql/kernel/qsqldatabase.h
@@ -23,7 +23,7 @@ class QThread;
class Q_SQL_EXPORT QSqlDriverCreatorBase
{
public:
- virtual ~QSqlDriverCreatorBase() {}
+ virtual ~QSqlDriverCreatorBase();
virtual QSqlDriver *createObject() const = 0;
};
@@ -82,7 +82,7 @@ public:
void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy);
QSql::NumericalPrecisionPolicy numericalPrecisionPolicy() const;
bool moveToThread(QThread *targetThread);
- QThread *currentThread() const;
+ QThread *thread() const;
QSqlDriver* driver() const;
diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp
index 14a1116531..63f782fe22 100644
--- a/src/sql/kernel/qsqlquery.cpp
+++ b/src/sql/kernel/qsqlquery.cpp
@@ -20,7 +20,7 @@
QT_BEGIN_NAMESPACE
-static Q_LOGGING_CATEGORY(lcSqlQuery, "qt.sql.qsqlquery")
+Q_STATIC_LOGGING_CATEGORY(lcSqlQuery, "qt.sql.qsqlquery")
class QSqlQueryPrivate
{
@@ -330,21 +330,13 @@ bool QSqlQuery::isNull(int field) const
/*!
\overload
-*/
-bool QSqlQuery::isNull(const QString &name) const
-{
- return isNull(QStringView(name));
-}
-
-/*!
- \overload
Returns \c true if there is no field with this \a name; otherwise
returns isNull(int index) for the corresponding field index.
This overload is less efficient than \l{QSqlQuery::}{isNull()}
*/
-bool QSqlQuery::isNull(QStringView name) const
+bool QSqlQuery::isNull(QAnyStringView name) const
{
qsizetype index = d->sqlResult->record().indexOf(name);
if (index > -1)
@@ -449,21 +441,13 @@ QVariant QSqlQuery::value(int index) const
/*!
\overload
-*/
-QVariant QSqlQuery::value(const QString &name) const
-{
- return value(QStringView(name));
-}
-
-/*!
- \overload
Returns the value of the field called \a name in the current record.
If field \a name does not exist an invalid variant is returned.
This overload is less efficient than \l{QSqlQuery::}{value()}
*/
-QVariant QSqlQuery::value(QStringView name) const
+QVariant QSqlQuery::value(QAnyStringView name) const
{
qsizetype index = d->sqlResult->record().indexOf(name);
if (index > -1)
diff --git a/src/sql/kernel/qsqlquery.h b/src/sql/kernel/qsqlquery.h
index 244b026205..bd3fea9e3e 100644
--- a/src/sql/kernel/qsqlquery.h
+++ b/src/sql/kernel/qsqlquery.h
@@ -55,8 +55,10 @@ public:
bool isValid() const;
bool isActive() const;
bool isNull(int field) const;
+#if QT_SQL_REMOVED_SINCE(6, 8)
bool isNull(const QString &name) const;
- bool isNull(QStringView name) const;
+#endif
+ bool isNull(QAnyStringView name) const;
int at() const;
QString lastQuery() const;
int numRowsAffected() const;
@@ -71,8 +73,10 @@ public:
void setForwardOnly(bool forward);
bool exec(const QString& query);
QVariant value(int i) const;
+#if QT_SQL_REMOVED_SINCE(6, 8)
QVariant value(const QString &name) const;
- QVariant value(QStringView name) const;
+#endif
+ QVariant value(QAnyStringView name) const;
void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy);
QSql::NumericalPrecisionPolicy numericalPrecisionPolicy() const;
diff --git a/src/sql/kernel/qsqlrecord.cpp b/src/sql/kernel/qsqlrecord.cpp
index 53b64c1464..89af1a52fe 100644
--- a/src/sql/kernel/qsqlrecord.cpp
+++ b/src/sql/kernel/qsqlrecord.cpp
@@ -19,6 +19,33 @@ public:
return index >= 0 && index < fields.size();
}
+ template <typename T>
+ qsizetype indexOfImpl(T name)
+ {
+ T tableName;
+ T fieldName;
+ const auto it = std::find(name.begin(), name.end(), u'.');
+ const auto idx = (it == name.end()) ? -1 : it - name.begin();
+ if (idx != -1) {
+ tableName = name.left(idx);
+ fieldName = name.mid(idx + 1);
+ }
+ const auto cnt = fields.size();
+ for (qsizetype i = 0; i < cnt; ++i) {
+ // Check the passed in name first in case it is an alias using a dot.
+ // Then check if both the table and field match when there is a table name specified.
+ const auto &currentField = fields.at(i);
+ const auto &currentFieldName = currentField.name();
+ if (name.compare(currentFieldName, Qt::CaseInsensitive) == 0)
+ return i;
+ if (idx != -1 &&
+ tableName.compare(currentField.tableName(), Qt::CaseInsensitive) == 0 &&
+ fieldName.compare(currentFieldName, Qt::CaseInsensitive) == 0)
+ return i;
+ }
+ return -1;
+ }
+
QList<QSqlField> fields;
};
QT_DEFINE_QESDP_SPECIALIZATION_DTOR(QSqlRecordPrivate)
@@ -162,21 +189,13 @@ QVariant QSqlRecord::value(int index) const
/*!
\overload
-*/
-QVariant QSqlRecord::value(const QString &name) const
-{
- return value(QStringView(name));
-}
-
-/*!
- \overload
Returns the value of the field called \a name in the record. If
field \a name does not exist an invalid variant is returned.
\sa indexOf(), isNull()
*/
-QVariant QSqlRecord::value(QStringView name) const
+QVariant QSqlRecord::value(QAnyStringView name) const
{
return value(indexOf(name));
}
@@ -194,14 +213,6 @@ QString QSqlRecord::fieldName(int index) const
}
/*!
- \overload
-*/
-int QSqlRecord::indexOf(const QString &name) const
-{
- return indexOf(QStringView(name));
-}
-
-/*!
Returns the position of the field called \a name within the
record, or -1 if it cannot be found. Field names are not
case-sensitive. If more than one field matches, the first one is
@@ -209,28 +220,12 @@ int QSqlRecord::indexOf(const QString &name) const
\sa fieldName()
*/
-int QSqlRecord::indexOf(QStringView name) const
+int QSqlRecord::indexOf(QAnyStringView name) const
{
- QStringView tableName;
- QStringView fieldName(name);
- const qsizetype idx = name.indexOf(u'.');
- if (idx != -1) {
- tableName = fieldName.left(idx);
- fieldName = fieldName.mid(idx + 1);
- }
- const int cnt = count();
- for (int i = 0; i < cnt; ++i) {
- // Check the passed in name first in case it is an alias using a dot.
- // Then check if both the table and field match when there is a table name specified.
- const auto &currentField = d->fields.at(i);
- const auto &currentFieldName = currentField.name();
- if (currentFieldName.compare(name, Qt::CaseInsensitive) == 0
- || (idx != -1 && currentFieldName.compare(fieldName, Qt::CaseInsensitive) == 0
- && currentField.tableName().compare(tableName, Qt::CaseInsensitive) == 0)) {
- return i;
- }
- }
- return -1;
+ return name.visit([&](auto v)
+ {
+ return d->indexOfImpl(v);
+ });
}
/*!
@@ -245,20 +240,12 @@ QSqlField QSqlRecord::field(int index) const
/*!
\overload
- */
-QSqlField QSqlRecord::field(const QString &name) const
-{
- return field(QStringView(name));
-}
-
-/*!
- \overload
Returns the field called \a name. If the field called
\a name is not found, function returns
a \l{default-constructed value}.
*/
-QSqlField QSqlRecord::field(QStringView name) const
+QSqlField QSqlRecord::field(QAnyStringView name) const
{
return field(indexOf(name));
}
@@ -343,20 +330,11 @@ bool QSqlRecord::isEmpty() const
return d->fields.isEmpty();
}
-
-/*!
- \overload
-*/
-bool QSqlRecord::contains(const QString &name) const
-{
- return contains(QStringView(name));
-}
-
/*!
Returns \c true if there is a field in the record called \a name;
otherwise returns \c false.
*/
-bool QSqlRecord::contains(QStringView name) const
+bool QSqlRecord::contains(QAnyStringView name) const
{
return indexOf(name) >= 0;
}
@@ -376,13 +354,6 @@ void QSqlRecord::clearValues()
}
/*!
- \overload
-*/
-void QSqlRecord::setGenerated(const QString &name, bool generated)
-{
- setGenerated(QStringView(name), generated);
-}
-/*!
Sets the generated flag for the field called \a name to \a
generated. If the field does not exist, nothing happens. Only
fields that have \a generated set to true are included in the SQL
@@ -390,7 +361,7 @@ void QSqlRecord::setGenerated(const QString &name, bool generated)
\sa isGenerated()
*/
-void QSqlRecord::setGenerated(QStringView name, bool generated)
+void QSqlRecord::setGenerated(QAnyStringView name, bool generated)
{
setGenerated(indexOf(name), generated);
}
@@ -422,21 +393,13 @@ bool QSqlRecord::isNull(int index) const
/*!
\overload
-*/
-bool QSqlRecord::isNull(const QString &name) const
-{
- return isNull(QStringView(name));
-}
-
-/*!
- \overload
Returns \c true if the field called \a name is null or if there is no
field called \a name; otherwise returns \c false.
\sa setNull()
*/
-bool QSqlRecord::isNull(QStringView name) const
+bool QSqlRecord::isNull(QAnyStringView name) const
{
return isNull(indexOf(name));
}
@@ -457,40 +420,24 @@ void QSqlRecord::setNull(int index)
/*!
\overload
-*/
-void QSqlRecord::setNull(const QString &name)
-{
- setNull(QStringView(name));
-}
-
-/*!
- \overload
Sets the value of the field called \a name to null. If the field
does not exist, nothing happens.
*/
-void QSqlRecord::setNull(QStringView name)
+void QSqlRecord::setNull(QAnyStringView name)
{
setNull(indexOf(name));
}
/*!
\overload
-*/
-bool QSqlRecord::isGenerated(const QString &name) const
-{
- return isGenerated(QStringView(name));
-}
-
-/*!
- \overload
Returns \c true if the record has a field called \a name and this
field is to be generated (the default); otherwise returns \c false.
\sa setGenerated()
*/
-bool QSqlRecord::isGenerated(QStringView name) const
+bool QSqlRecord::isGenerated(QAnyStringView name) const
{
return isGenerated(indexOf(name));
}
@@ -534,20 +481,13 @@ void QSqlRecord::setValue(int index, const QVariant &val)
/*!
\overload
-*/
-void QSqlRecord::setValue(const QString &name, const QVariant &val)
-{
- setValue(QStringView(name), val);
-}
-/*!
- \overload
Sets the value of the field called \a name to \a val. If the field
does not exist, nothing happens.
\sa setNull()
*/
-void QSqlRecord::setValue(QStringView name, const QVariant &val)
+void QSqlRecord::setValue(QAnyStringView name, const QVariant &val)
{
setValue(indexOf(name), val);
}
diff --git a/src/sql/kernel/qsqlrecord.h b/src/sql/kernel/qsqlrecord.h
index 8f653ba5e1..aea9af7295 100644
--- a/src/sql/kernel/qsqlrecord.h
+++ b/src/sql/kernel/qsqlrecord.h
@@ -32,32 +32,48 @@ public:
inline bool operator!=(const QSqlRecord &other) const { return !operator==(other); }
QVariant value(int i) const;
+#if QT_SQL_REMOVED_SINCE(6, 8)
QVariant value(const QString &name) const;
- QVariant value(QStringView name) const;
+#endif
+ QVariant value(QAnyStringView name) const;
void setValue(int i, const QVariant &val);
+#if QT_SQL_REMOVED_SINCE(6, 8)
void setValue(const QString &name, const QVariant &val);
- void setValue(QStringView name, const QVariant &val);
+#endif
+ void setValue(QAnyStringView name, const QVariant &val);
void setNull(int i);
+#if QT_SQL_REMOVED_SINCE(6, 8)
void setNull(const QString &name);
- void setNull(QStringView name);
+#endif
+ void setNull(QAnyStringView name);
bool isNull(int i) const;
+#if QT_SQL_REMOVED_SINCE(6, 8)
bool isNull(const QString &name) const;
- bool isNull(QStringView name) const;
+#endif
+ bool isNull(QAnyStringView name) const;
+#if QT_SQL_REMOVED_SINCE(6, 8)
int indexOf(const QString &name) const;
- int indexOf(QStringView name) const;
+#endif
+ int indexOf(QAnyStringView name) const;
QString fieldName(int i) const;
QSqlField field(int i) const;
+#if QT_SQL_REMOVED_SINCE(6, 8)
QSqlField field(const QString &name) const;
- QSqlField field(QStringView name) const;
+#endif
+ QSqlField field(QAnyStringView name) const;
bool isGenerated(int i) const;
+#if QT_SQL_REMOVED_SINCE(6, 8)
bool isGenerated(const QString &name) const;
- bool isGenerated(QStringView name) const;
+#endif
+ bool isGenerated(QAnyStringView name) const;
+#if QT_SQL_REMOVED_SINCE(6, 8)
void setGenerated(const QString &name, bool generated);
- void setGenerated(QStringView name, bool generated);
+#endif
+ void setGenerated(QAnyStringView name, bool generated);
void setGenerated(int i, bool generated);
void append(const QSqlField &field);
@@ -66,8 +82,10 @@ public:
void remove(int pos);
bool isEmpty() const;
+#if QT_SQL_REMOVED_SINCE(6, 8)
bool contains(const QString &name) const;
- bool contains(QStringView name) const;
+#endif
+ bool contains(QAnyStringView name) const;
void clear();
void clearValues();
int count() const;
diff --git a/src/sql/models/qsqlquerymodel.cpp b/src/sql/models/qsqlquerymodel.cpp
index 6f91fb9739..1aae088c64 100644
--- a/src/sql/models/qsqlquerymodel.cpp
+++ b/src/sql/models/qsqlquerymodel.cpp
@@ -618,7 +618,7 @@ bool QSqlQueryModel::insertColumns(int column, int count, const QModelIndex &par
d->colOffsets.append(nVal);
Q_ASSERT(d->colOffsets.size() >= d->rec.count());
}
- for (int i = column + 1; i < d->colOffsets.size(); ++i)
+ for (qsizetype i = column + 1; i < d->colOffsets.size(); ++i)
++d->colOffsets[i];
}
endInsertColumns();
@@ -644,10 +644,9 @@ bool QSqlQueryModel::removeColumns(int column, int count, const QModelIndex &par
beginRemoveColumns(parent, column, column + count - 1);
- int i;
- for (i = 0; i < count; ++i)
+ for (int i = 0; i < count; ++i)
d->rec.remove(column);
- for (i = column; i < d->colOffsets.size(); ++i)
+ for (qsizetype i = column; i < d->colOffsets.size(); ++i)
d->colOffsets[i] -= count;
endRemoveColumns();
diff --git a/src/sql/models/qsqlrelationaltablemodel.cpp b/src/sql/models/qsqlrelationaltablemodel.cpp
index c086d88ffe..1218514778 100644
--- a/src/sql/models/qsqlrelationaltablemodel.cpp
+++ b/src/sql/models/qsqlrelationaltablemodel.cpp
@@ -21,7 +21,7 @@ QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
-class QSqlRelationalTableModelSql: public QSqlTableModelSql
+class QSqlRelationalTableModelSql: public QSqlQueryModelSql
{
public:
inline const static QString relTablePrefix(int i) { return QString::number(i).prepend("relTblAl_"_L1); }
@@ -108,12 +108,12 @@ struct QRelation
void populateModel();
- bool isDictionaryInitialized();
+ bool isDictionaryInitialized() const;
void populateDictionary();
void clearDictionary();
void clear();
- bool isValid();
+ bool isValid() const;
QSqlRelation rel;
QRelatedTableModel *model;
@@ -158,7 +158,7 @@ void QRelation::populateModel()
}
}
-bool QRelation::isDictionaryInitialized()
+bool QRelation::isDictionaryInitialized() const
{
return m_dictInitialized;
}
@@ -204,7 +204,7 @@ void QRelation::clear()
clearDictionary();
}
-bool QRelation::isValid()
+bool QRelation::isValid() const
{
return (rel.isValid() && m_parent != nullptr);
}
@@ -253,10 +253,8 @@ public:
void QSqlRelationalTableModelPrivate::clearChanges()
{
- for (int i = 0; i < relations.size(); ++i) {
- QRelation &rel = relations[i];
+ for (auto &rel : relations)
rel.clear();
- }
}
void QSqlRelationalTableModelPrivate::revertCachedRow(int row)
@@ -277,8 +275,8 @@ int QSqlRelationalTableModelPrivate::nameToIndex(const QString &name) const
void QSqlRelationalTableModelPrivate::clearCache()
{
- for (int i = 0; i < relations.size(); ++i)
- relations[i].clearDictionary();
+ for (auto &rel : relations)
+ rel.clearDictionary();
QSqlTableModelPrivate::clearCache();
}
diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp
index 265d7782a0..0d17194287 100644
--- a/src/sql/models/qsqltablemodel.cpp
+++ b/src/sql/models/qsqltablemodel.cpp
@@ -19,12 +19,7 @@ QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
-using SqlTm = QSqlTableModelSql;
-
-QSqlTableModelPrivate::~QSqlTableModelPrivate()
-{
-
-}
+using SqlTm = QSqlQueryModelSql;
/*! \internal
Populates our record with values.
@@ -143,11 +138,10 @@ bool QSqlTableModelPrivate::exec(const QString &stmt, bool prepStatement,
return false;
}
}
- int i;
- for (i = 0; i < rec.count(); ++i)
+ for (int i = 0; i < rec.count(); ++i)
if (rec.isGenerated(i))
editQuery.addBindValue(rec.value(i));
- for (i = 0; i < whereValues.count(); ++i)
+ for (int i = 0; i < whereValues.count(); ++i)
if (whereValues.isGenerated(i) && !whereValues.isNull(i))
editQuery.addBindValue(whereValues.value(i));
@@ -475,10 +469,8 @@ QVariant QSqlTableModel::headerData(int section, Qt::Orientation orientation, in
bool QSqlTableModel::isDirty() const
{
Q_D(const QSqlTableModel);
- QSqlTableModelPrivate::CacheMap::ConstIterator i = d->cache.constBegin();
- const QSqlTableModelPrivate::CacheMap::ConstIterator e = d->cache.constEnd();
- for (; i != e; ++i) {
- if (!i.value().submitted())
+ for (const auto &val : std::as_const(d->cache)) {
+ if (!val.submitted())
return true;
}
return false;
@@ -1360,8 +1352,7 @@ bool QSqlTableModel::setRecord(int row, const QSqlRecord &values)
return false;
// Check field names and remember mapping
- typedef QMap<int, int> Map;
- Map map;
+ QMap<int, int> map;
for (int i = 0; i < values.count(); ++i) {
int idx = d->nameToIndex(values.fieldName(i));
if (idx == -1)
@@ -1374,18 +1365,16 @@ bool QSqlTableModel::setRecord(int row, const QSqlRecord &values)
mrow = QSqlTableModelPrivate::ModifiedRow(QSqlTableModelPrivate::Update,
QSqlQueryModel::record(row));
- Map::const_iterator i = map.constBegin();
- const Map::const_iterator e = map.constEnd();
- for ( ; i != e; ++i) {
+ for (const auto i : map.asKeyValueRange()) {
// have to use virtual setData() here rather than mrow.setValue()
EditStrategy strategy = d->strategy;
d->strategy = OnManualSubmit;
- QModelIndex cIndex = createIndex(row, i.value());
- setData(cIndex, values.value(i.key()));
+ QModelIndex cIndex = createIndex(row, i.second);
+ setData(cIndex, values.value(i.first));
d->strategy = strategy;
// setData() sets generated to TRUE, but source record should prevail.
- if (!values.isGenerated(i.key()))
- mrow.recRef().setGenerated(i.value(), false);
+ if (!values.isGenerated(i.first))
+ mrow.recRef().setGenerated(i.second, false);
}
if (d->strategy != OnManualSubmit)
diff --git a/src/sql/models/qsqltablemodel_p.h b/src/sql/models/qsqltablemodel_p.h
index 9c6425ded4..864c977ebb 100644
--- a/src/sql/models/qsqltablemodel_p.h
+++ b/src/sql/models/qsqltablemodel_p.h
@@ -35,7 +35,6 @@ public:
strategy(QSqlTableModel::OnRowChange),
busyInsertingRows(false)
{}
- ~QSqlTableModelPrivate();
void clear();
virtual void clearCache();
@@ -154,11 +153,6 @@ public:
CacheMap cache;
};
-class QSqlTableModelSql: public QSqlQueryModelSql
-{
-public:
-};
-
QT_END_NAMESPACE
#endif // QSQLTABLEMODEL_P_H