200 d->
len = fieldLength;
395{
return val.isNull(); }
399void QSqlField::detach()
490#ifndef QT_NO_DEBUG_STREAM
495 dbg <<
"QSqlField(" <<
f.name() <<
", " <<
f.metaType().name();
496 dbg <<
", tableName: " << (
f.tableName().isEmpty() ?
QStringLiteral(
"(not specified)") :
f.tableName());
498 dbg <<
", length: " <<
f.length();
499 if (
f.precision() >= 0)
500 dbg <<
", precision: " <<
f.precision();
502 dbg <<
", required: "
504 dbg <<
", generated: " << (
f.isGenerated() ?
"yes" :
"no");
506 dbg <<
", typeID: " <<
f.typeID();
507 if (!
f.defaultValue().isNull())
508 dbg <<
", defaultValue: \"" <<
f.defaultValue() <<
'\"';
509 dbg <<
", autoValue: " <<
f.isAutoValue()
510 <<
", readOnly: " <<
f.isReadOnly() <<
')';
void detach()
If the shared data object's reference count is greater than 1, this function creates a deep copy of t...
QSqlField::RequiredStatus req
bool operator==(const QSqlFieldPrivate &other) const
QSqlFieldPrivate(const QString &name, QMetaType type, const QString &tableName)
The QSqlField class manipulates the fields in SQL database tables and views.
QSqlField(const QString &fieldName=QString(), QMetaType type=QMetaType(), const QString &tableName=QString())
RequiredStatus
Specifies whether the field is required or optional.
void setAutoValue(bool autoVal)
Marks the field as an auto-generated value if autoVal is true.
bool isGenerated() const
Returns true if the field is generated; otherwise returns false.
void setRequiredStatus(RequiredStatus status)
Sets the required status of this field to required.
QMetaType metaType() const
Returns the field's type as stored in the database.
bool isValid() const
Returns true if the field's variant type is valid; otherwise returns false.
bool operator==(const QSqlField &other) const
Returns true if the field is equal to other; otherwise returns false.
void setValue(const QVariant &value)
Sets the value of the field to value.
void setLength(int fieldLength)
Sets the field's length to fieldLength.
void setDefaultValue(const QVariant &value)
Sets the default value used for this field to value.
void setName(const QString &name)
Sets the name of the field to name.
RequiredStatus requiredStatus() const
Returns true if this is a required field; otherwise returns false.
QString tableName() const
Returns the tableName of the field.
void setMetaType(QMetaType type)
Set's the field's variant type to type.
int precision() const
Returns the field's precision; this is only meaningful for numeric types.
void setReadOnly(bool readOnly)
Sets the read only flag of the field's value to readOnly.
void clear()
Clears the value of the field and sets it to NULL.
~QSqlField()
Destroys the object and frees any allocated resources.
QVariant value() const
Returns the value of the field as a QVariant.
bool isNull() const
Returns true if the field's value is NULL; otherwise returns false.
QVariant defaultValue() const
Returns the field's default value (which may be NULL).
bool isAutoValue() const
Returns true if the value is auto-generated by the database, for example auto-increment primary key v...
bool isReadOnly() const
Returns true if the field's value is read-only; otherwise returns false.
void setPrecision(int precision)
Sets the field's precision.
void setSqlType(int type)
void setTableName(const QString &tableName)
Sets the tableName of the field to table.
void setGenerated(bool gen)
Sets the generated state.
QString name() const
Returns the name of the field.
int length() const
Returns the field's length.
QSqlField & operator=(const QSqlField &other)
Sets the field equal to other.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum GLenum GLsizei void * table
GLenum GLint GLint * precision
#define QT_DEFINE_QESDP_SPECIALIZATION_DTOR(Class)
QDebug operator<<(QDebug dbg, const QSqlField &f)
#define QStringLiteral(str)