QSqlRecord: style fixes
Misc style fixes in preparation for the new overloads taking QStringView. Pick-to: 6.6 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>
This commit is contained in:
parent
d7bc61ac51
commit
41eb889352
@ -75,7 +75,7 @@ QSqlRecord::QSqlRecord()
|
||||
of a record in \l{constant time}.
|
||||
*/
|
||||
|
||||
QSqlRecord::QSqlRecord(const QSqlRecord& other)
|
||||
QSqlRecord::QSqlRecord(const QSqlRecord &other)
|
||||
= default;
|
||||
|
||||
/*!
|
||||
@ -116,7 +116,7 @@ QSqlRecord::QSqlRecord(const QSqlRecord& other)
|
||||
of a record in \l{constant time}.
|
||||
*/
|
||||
|
||||
QSqlRecord& QSqlRecord::operator=(const QSqlRecord& other)
|
||||
QSqlRecord& QSqlRecord::operator=(const QSqlRecord &other)
|
||||
= default;
|
||||
|
||||
/*!
|
||||
@ -169,7 +169,7 @@ QVariant QSqlRecord::value(int index) const
|
||||
\sa indexOf()
|
||||
*/
|
||||
|
||||
QVariant QSqlRecord::value(const QString& name) const
|
||||
QVariant QSqlRecord::value(const QString &name) const
|
||||
{
|
||||
return value(indexOf(name));
|
||||
}
|
||||
@ -195,7 +195,7 @@ QString QSqlRecord::fieldName(int index) const
|
||||
\sa fieldName()
|
||||
*/
|
||||
|
||||
int QSqlRecord::indexOf(const QString& name) const
|
||||
int QSqlRecord::indexOf(const QString &name) const
|
||||
{
|
||||
QStringView tableName;
|
||||
QStringView fieldName(name);
|
||||
@ -244,7 +244,7 @@ QSqlField QSqlRecord::field(const QString &name) const
|
||||
\sa insert(), replace(), remove()
|
||||
*/
|
||||
|
||||
void QSqlRecord::append(const QSqlField& field)
|
||||
void QSqlRecord::append(const QSqlField &field)
|
||||
{
|
||||
detach();
|
||||
d->fields.append(field);
|
||||
@ -255,7 +255,7 @@ void QSqlRecord::append(const QSqlField& field)
|
||||
|
||||
\sa append(), replace(), remove()
|
||||
*/
|
||||
void QSqlRecord::insert(int pos, const QSqlField& field)
|
||||
void QSqlRecord::insert(int pos, const QSqlField &field)
|
||||
{
|
||||
detach();
|
||||
d->fields.insert(pos, field);
|
||||
@ -268,7 +268,7 @@ void QSqlRecord::insert(int pos, const QSqlField& field)
|
||||
\sa append(), insert(), remove()
|
||||
*/
|
||||
|
||||
void QSqlRecord::replace(int pos, const QSqlField& field)
|
||||
void QSqlRecord::replace(int pos, const QSqlField &field)
|
||||
{
|
||||
if (!d->contains(pos))
|
||||
return;
|
||||
@ -323,7 +323,7 @@ bool QSqlRecord::isEmpty() const
|
||||
otherwise returns \c false.
|
||||
*/
|
||||
|
||||
bool QSqlRecord::contains(const QString& name) const
|
||||
bool QSqlRecord::contains(const QString &name) const
|
||||
{
|
||||
return indexOf(name) >= 0;
|
||||
}
|
||||
@ -351,7 +351,7 @@ void QSqlRecord::clearValues()
|
||||
\sa isGenerated()
|
||||
*/
|
||||
|
||||
void QSqlRecord::setGenerated(const QString& name, bool generated)
|
||||
void QSqlRecord::setGenerated(const QString &name, bool generated)
|
||||
{
|
||||
setGenerated(indexOf(name), generated);
|
||||
}
|
||||
@ -389,7 +389,7 @@ bool QSqlRecord::isNull(int index) const
|
||||
|
||||
\sa setNull()
|
||||
*/
|
||||
bool QSqlRecord::isNull(const QString& name) const
|
||||
bool QSqlRecord::isNull(const QString &name) const
|
||||
{
|
||||
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
|
||||
does not exist, nothing happens.
|
||||
*/
|
||||
void QSqlRecord::setNull(const QString& name)
|
||||
void QSqlRecord::setNull(const QString &name)
|
||||
{
|
||||
setNull(indexOf(name));
|
||||
}
|
||||
@ -426,7 +426,7 @@ void QSqlRecord::setNull(const QString& name)
|
||||
|
||||
\sa setGenerated()
|
||||
*/
|
||||
bool QSqlRecord::isGenerated(const QString& name) const
|
||||
bool QSqlRecord::isGenerated(const QString &name) const
|
||||
{
|
||||
return isGenerated(indexOf(name));
|
||||
}
|
||||
@ -461,7 +461,7 @@ int QSqlRecord::count() const
|
||||
\sa setNull()
|
||||
*/
|
||||
|
||||
void QSqlRecord::setValue(int index, const QVariant& val)
|
||||
void QSqlRecord::setValue(int index, const QVariant &val)
|
||||
{
|
||||
if (!d->contains(index))
|
||||
return;
|
||||
@ -477,7 +477,7 @@ void QSqlRecord::setValue(int index, const QVariant& val)
|
||||
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);
|
||||
}
|
||||
|
@ -20,9 +20,9 @@ class Q_SQL_EXPORT QSqlRecord
|
||||
{
|
||||
public:
|
||||
QSqlRecord();
|
||||
QSqlRecord(const QSqlRecord& other);
|
||||
QSqlRecord(const QSqlRecord &other);
|
||||
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)
|
||||
~QSqlRecord();
|
||||
|
||||
@ -32,14 +32,14 @@ public:
|
||||
inline bool operator!=(const QSqlRecord &other) const { return !operator==(other); }
|
||||
|
||||
QVariant value(int i) const;
|
||||
QVariant value(const QString& name) const;
|
||||
void setValue(int i, const QVariant& val);
|
||||
void setValue(const QString& name, const QVariant& val);
|
||||
QVariant value(const QString &name) const;
|
||||
void setValue(int i, const QVariant &val);
|
||||
void setValue(const QString &name, const QVariant &val);
|
||||
|
||||
void setNull(int i);
|
||||
void setNull(const QString& name);
|
||||
void setNull(const QString &name);
|
||||
bool isNull(int i) const;
|
||||
bool isNull(const QString& name) const;
|
||||
bool isNull(const QString &name) const;
|
||||
|
||||
int indexOf(const QString &name) const;
|
||||
QString fieldName(int i) const;
|
||||
@ -48,17 +48,17 @@ public:
|
||||
QSqlField field(const QString &name) const;
|
||||
|
||||
bool isGenerated(int i) const;
|
||||
bool isGenerated(const QString& name) const;
|
||||
void setGenerated(const QString& name, bool generated);
|
||||
bool isGenerated(const QString &name) const;
|
||||
void setGenerated(const QString &name, bool generated);
|
||||
void setGenerated(int i, bool generated);
|
||||
|
||||
void append(const QSqlField& field);
|
||||
void replace(int pos, const QSqlField& field);
|
||||
void insert(int pos, const QSqlField& field);
|
||||
void append(const QSqlField &field);
|
||||
void replace(int pos, const QSqlField &field);
|
||||
void insert(int pos, const QSqlField &field);
|
||||
void remove(int pos);
|
||||
|
||||
bool isEmpty() const;
|
||||
bool contains(const QString& name) const;
|
||||
bool contains(const QString &name) const;
|
||||
void clear();
|
||||
void clearValues();
|
||||
int count() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user