QSqlRecord: style fixes

Misc style fixes in preparation for the new overloads taking
QStringView.

Pick-to: 6.5
Change-Id: I3b838543aefd08bf115488e571b1bb6eec8d968d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ddad911f9be71d3a1396e28261ffe386e880aa69)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 41eb8893525733bd65fd2b4d7a7abf100bf78516)
This commit is contained in:
Christian Ehrlicher 2023-12-22 20:32:13 +01:00 committed by Qt Cherry-pick Bot
parent dd1bddaf36
commit 2af50f6c81
2 changed files with 27 additions and 27 deletions

View File

@ -75,7 +75,7 @@ QSqlRecord::QSqlRecord()
of a record in \l{constant time}. of a record in \l{constant time}.
*/ */
QSqlRecord::QSqlRecord(const QSqlRecord& other) QSqlRecord::QSqlRecord(const QSqlRecord &other)
= default; = default;
/*! /*!
@ -116,7 +116,7 @@ QSqlRecord::QSqlRecord(const QSqlRecord& other)
of a record in \l{constant time}. of a record in \l{constant time}.
*/ */
QSqlRecord& QSqlRecord::operator=(const QSqlRecord& other) QSqlRecord& QSqlRecord::operator=(const QSqlRecord &other)
= default; = default;
/*! /*!
@ -169,7 +169,7 @@ QVariant QSqlRecord::value(int index) const
\sa indexOf() \sa indexOf()
*/ */
QVariant QSqlRecord::value(const QString& name) const QVariant QSqlRecord::value(const QString &name) const
{ {
return value(indexOf(name)); return value(indexOf(name));
} }
@ -195,7 +195,7 @@ QString QSqlRecord::fieldName(int index) const
\sa fieldName() \sa fieldName()
*/ */
int QSqlRecord::indexOf(const QString& name) const int QSqlRecord::indexOf(const QString &name) const
{ {
QStringView tableName; QStringView tableName;
QStringView fieldName(name); QStringView fieldName(name);
@ -244,7 +244,7 @@ QSqlField QSqlRecord::field(const QString &name) const
\sa insert(), replace(), remove() \sa insert(), replace(), remove()
*/ */
void QSqlRecord::append(const QSqlField& field) void QSqlRecord::append(const QSqlField &field)
{ {
detach(); detach();
d->fields.append(field); d->fields.append(field);
@ -255,7 +255,7 @@ void QSqlRecord::append(const QSqlField& field)
\sa append(), replace(), remove() \sa append(), replace(), remove()
*/ */
void QSqlRecord::insert(int pos, const QSqlField& field) void QSqlRecord::insert(int pos, const QSqlField &field)
{ {
detach(); detach();
d->fields.insert(pos, field); d->fields.insert(pos, field);
@ -268,7 +268,7 @@ void QSqlRecord::insert(int pos, const QSqlField& field)
\sa append(), insert(), remove() \sa append(), insert(), remove()
*/ */
void QSqlRecord::replace(int pos, const QSqlField& field) void QSqlRecord::replace(int pos, const QSqlField &field)
{ {
if (!d->contains(pos)) if (!d->contains(pos))
return; return;
@ -323,7 +323,7 @@ bool QSqlRecord::isEmpty() const
otherwise returns \c false. otherwise returns \c false.
*/ */
bool QSqlRecord::contains(const QString& name) const bool QSqlRecord::contains(const QString &name) const
{ {
return indexOf(name) >= 0; return indexOf(name) >= 0;
} }
@ -351,7 +351,7 @@ void QSqlRecord::clearValues()
\sa isGenerated() \sa isGenerated()
*/ */
void QSqlRecord::setGenerated(const QString& name, bool generated) void QSqlRecord::setGenerated(const QString &name, bool generated)
{ {
setGenerated(indexOf(name), generated); setGenerated(indexOf(name), generated);
} }
@ -389,7 +389,7 @@ bool QSqlRecord::isNull(int index) const
\sa setNull() \sa setNull()
*/ */
bool QSqlRecord::isNull(const QString& name) const bool QSqlRecord::isNull(const QString &name) const
{ {
return isNull(indexOf(name)); return isNull(indexOf(name));
} }
@ -414,7 +414,7 @@ void QSqlRecord::setNull(int index)
Sets the value of the field called \a name to null. If the field Sets the value of the field called \a name to null. If the field
does not exist, nothing happens. does not exist, nothing happens.
*/ */
void QSqlRecord::setNull(const QString& name) void QSqlRecord::setNull(const QString &name)
{ {
setNull(indexOf(name)); setNull(indexOf(name));
} }
@ -426,7 +426,7 @@ void QSqlRecord::setNull(const QString& name)
\sa setGenerated() \sa setGenerated()
*/ */
bool QSqlRecord::isGenerated(const QString& name) const bool QSqlRecord::isGenerated(const QString &name) const
{ {
return isGenerated(indexOf(name)); return isGenerated(indexOf(name));
} }
@ -461,7 +461,7 @@ int QSqlRecord::count() const
\sa setNull() \sa setNull()
*/ */
void QSqlRecord::setValue(int index, const QVariant& val) void QSqlRecord::setValue(int index, const QVariant &val)
{ {
if (!d->contains(index)) if (!d->contains(index))
return; return;
@ -477,7 +477,7 @@ void QSqlRecord::setValue(int index, const QVariant& val)
does not exist, nothing happens. does not exist, nothing happens.
*/ */
void QSqlRecord::setValue(const QString& name, const QVariant& val) void QSqlRecord::setValue(const QString &name, const QVariant &val)
{ {
setValue(indexOf(name), val); setValue(indexOf(name), val);
} }

View File

@ -20,9 +20,9 @@ class Q_SQL_EXPORT QSqlRecord
{ {
public: public:
QSqlRecord(); QSqlRecord();
QSqlRecord(const QSqlRecord& other); QSqlRecord(const QSqlRecord &other);
QSqlRecord(QSqlRecord &&other) noexcept = default; QSqlRecord(QSqlRecord &&other) noexcept = default;
QSqlRecord& operator=(const QSqlRecord& other); QSqlRecord& operator=(const QSqlRecord &other);
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QSqlRecord) QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QSqlRecord)
~QSqlRecord(); ~QSqlRecord();
@ -32,14 +32,14 @@ public:
inline bool operator!=(const QSqlRecord &other) const { return !operator==(other); } inline bool operator!=(const QSqlRecord &other) const { return !operator==(other); }
QVariant value(int i) const; QVariant value(int i) const;
QVariant value(const QString& name) const; QVariant value(const QString &name) const;
void setValue(int i, const QVariant& val); void setValue(int i, const QVariant &val);
void setValue(const QString& name, const QVariant& val); void setValue(const QString &name, const QVariant &val);
void setNull(int i); void setNull(int i);
void setNull(const QString& name); void setNull(const QString &name);
bool isNull(int i) const; bool isNull(int i) const;
bool isNull(const QString& name) const; bool isNull(const QString &name) const;
int indexOf(const QString &name) const; int indexOf(const QString &name) const;
QString fieldName(int i) const; QString fieldName(int i) const;
@ -48,17 +48,17 @@ public:
QSqlField field(const QString &name) const; QSqlField field(const QString &name) const;
bool isGenerated(int i) const; bool isGenerated(int i) const;
bool isGenerated(const QString& name) const; bool isGenerated(const QString &name) const;
void setGenerated(const QString& name, bool generated); void setGenerated(const QString &name, bool generated);
void setGenerated(int i, bool generated); void setGenerated(int i, bool generated);
void append(const QSqlField& field); void append(const QSqlField &field);
void replace(int pos, const QSqlField& field); void replace(int pos, const QSqlField &field);
void insert(int pos, const QSqlField& field); void insert(int pos, const QSqlField &field);
void remove(int pos); void remove(int pos);
bool isEmpty() const; bool isEmpty() const;
bool contains(const QString& name) const; bool contains(const QString &name) const;
void clear(); void clear();
void clearValues(); void clearValues();
int count() const; int count() const;