Qt 4.8
Classes | Functions
qsqlfield.cpp File Reference
#include "qsqlfield.h"
#include "qatomic.h"
#include "qdebug.h"

Go to the source code of this file.

Classes

class  QSqlFieldPrivate
 

Functions

QDebug operator<< (QDebug dbg, const QSqlField &f)
 

Function Documentation

◆ operator<<()

QDebug operator<< ( QDebug  dbg,
const QSqlField f 
)

Definition at line 523 of file qsqlfield.cpp.

524 {
525 #ifndef Q_BROKEN_DEBUG_STREAM
526  dbg.nospace() << "QSqlField(" << f.name() << ", " << QVariant::typeToName(f.type());
527  if (f.length() >= 0)
528  dbg.nospace() << ", length: " << f.length();
529  if (f.precision() >= 0)
530  dbg.nospace() << ", precision: " << f.precision();
532  dbg.nospace() << ", required: "
533  << (f.requiredStatus() == QSqlField::Required ? "yes" : "no");
534  dbg.nospace() << ", generated: " << (f.isGenerated() ? "yes" : "no");
535  if (f.typeID() >= 0)
536  dbg.nospace() << ", typeID: " << f.typeID();
537  if (!f.defaultValue().isNull())
538  dbg.nospace() << ", auto-value: \"" << f.defaultValue() << '\"';
539  dbg.nospace() << ')';
540  return dbg.space();
541 #else
542  qWarning("This compiler doesn't support streaming QSqlField to QDebug");
543  return dbg;
544  Q_UNUSED(f);
545 #endif
546 }
bool isNull() const
Returns true if this is a NULL variant, false otherwise.
Definition: qvariant.cpp:3102
QDebug & nospace()
Clears the stream&#39;s internal flag that records whether the last character was a space and returns a r...
Definition: qdebug.h:92
static const char * typeToName(Type type)
Converts the enum representation of the storage type, typ, to its string representation.
Definition: qvariant.cpp:2008
QVariant defaultValue() const
Returns the field&#39;s default value (which may be NULL).
Definition: qsqlfield.cpp:481
QString name() const
Returns the name of the field.
Definition: qsqlfield.cpp:380
Q_CORE_EXPORT void qWarning(const char *,...)
QVariant::Type type() const
Returns the field&#39;s type as stored in the database.
Definition: qsqlfield.cpp:394
int precision() const
Returns the field&#39;s precision; this is only meaningful for numeric types.
Definition: qsqlfield.cpp:471
int length() const
Returns the field&#39;s length.
Definition: qsqlfield.cpp:457
int typeID() const
Returns the type ID for the field.
Definition: qsqlfield.cpp:497
QDebug & space()
Writes a space character to the debug stream and returns a reference to the stream.
Definition: qdebug.h:91
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
bool isGenerated() const
Returns true if the field is generated; otherwise returns false.
Definition: qsqlfield.cpp:508
RequiredStatus requiredStatus() const
Returns true if this is a required field; otherwise returns false.
Definition: qsqlfield.cpp:444