192 return d->fields == other.
d->
fields;
205 return d->fields.value(index).value();
222 return value(indexOf(name));
234 return d->fields.value(index).name();
249 for (
int i = 0; i < count(); ++i) {
250 if (
d->fields.at(i).name().toUpper() == nm)
263 if (!
d->contains(index))
266 return &
d->fields.at(index);
276 int i = indexOf(name);
280 return &
d->fields.at(i);
291 return d->fields.value(index);
302 return field(indexOf(name));
315 d->fields.append(field);
326 d->fields.insert(pos, field);
338 if (!
d->contains(pos))
342 d->fields[pos] = field;
354 if (!
d->contains(pos))
358 d->fields.remove(pos);
382 return d->fields.isEmpty();
393 return indexOf(name) >= 0;
406 int count =
d->fields.count();
407 for (
int i = 0; i < count; ++i)
408 d->fields[i].clear();
422 setGenerated(indexOf(name), generated);
438 if (!
d->contains(index))
441 d->fields[
index].setGenerated(generated);
455 return d->fields.value(index).isNull();
466 return isNull(indexOf(name));
477 if (!
d->contains(index))
494 setNull(indexOf(name));
506 return isGenerated(indexOf(name));
521 return d->fields.value(index).isGenerated();
537 for (
int i = 0; i < count(); ++i) {
538 if (!
d->fields.value(i).isGenerated()) {
541 pflist +=
d->createField(i, prefix);
559 for (
int i = 0; i < count(); ++i) {
560 if (!
d->fields.value(i).isGenerated())
561 s +=
d->createField(i, prefix);
565 #endif // QT3_SUPPORT 575 return d->fields.count();
587 if (!
d->contains(index))
590 d->fields[
index].setValue(val);
606 setValue(indexOf(name), val);
617 #ifndef QT_NO_DEBUG_STREAM 620 dbg <<
"QSqlRecord(" << r.
count() <<
')';
621 for (
int i = 0; i < r.
count(); ++i)
The QVariant class acts like a union for the most common Qt data types.
The QDebug class provides an output stream for debugging information.
void qAtomicDetach(T *&d)
This is a helper for the detach method of implicitly shared classes.
#define QT_END_NAMESPACE
This macro expands to.
The QAtomicInt class provides platform-independent atomic operations on integers. ...
int count(const T &t) const
Returns the number of occurrences of value in the vector.
QDebug operator<<(QDebug dbg, const QSqlRecord &r)
QString toUpper() const Q_REQUIRED_RESULT
Returns an uppercase copy of the string.
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
bool isEmpty() const
Returns true if there are no fields in the record; otherwise returns false.
bool isNull(int i) const
Returns true if the field index is null or if there is no field at position index; otherwise returns ...
The QSqlRecord class encapsulates a database record.
The QString class provides a Unicode character string.
QSqlRecord & operator=(const QSqlRecord &other)
Sets the record equal to other.
QSqlRecord()
Constructs an empty record.
QVector< QSqlField > fields
void clearValues()
Clears the value of all fields in the record and sets each field to null.
QString name() const
Returns the name of the field.
bool isGenerated(int i) const
Returns true if the record has a field at position index and this field is to be generated (the defau...
static QString toString(Register *reg, int type, bool *ok=0)
~QSqlRecord()
Destroys the object and frees any allocated resources.
void insert(int pos, const QSqlField &field)
Inserts the field field at position pos in the record.
#define QT_BEGIN_NAMESPACE
This macro expands to.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
The QStringList class provides a list of strings.
QSqlField field(int i) const
Returns the field at position index.
const T & at(int i) const
Returns the item at index position i in the vector.
void remove(int pos)
Removes the field at position pos.
int count() const
Returns the number of fields in the record.
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
QString createField(int index, const QString &prefix) const
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
void setNull(int i)
Sets the value of field index to null.
void replace(int pos, const QSqlField &field)
Replaces the field at position pos with the given field.
void append(const QSqlField &field)
Append a copy of field field to the end of the record.
void qAtomicAssign(T *&d, T *x)
This is a helper for the assignment operators of implicitly shared classes.
bool contains(const QString &name) const
Returns true if there is a field in the record called name; otherwise returns false.
void clear()
Removes all the record's fields.
bool operator==(const QSqlRecord &other) const
Returns true if this object is identical to other (i.e., has the same fields in the same order); othe...
void setValue(int i, const QVariant &val)
Sets the value of the field at position index to val.
The QSqlField class manipulates the fields in SQL database tables and views.
QString fieldName(int i) const
Returns the name of the field at position index.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
int indexOf(const QString &name) const
Returns the position of the field called name within the record, or -1 if it cannot be found...
QVariant value(int i) const
Returns the value of the field located at position index in the record.
static bool isNull(const QVariant::Private *d)
void setGenerated(const QString &name, bool generated)
Sets the generated flag for the field called name to generated.