QSqlFieldInfo(3qt)
π QSqlFieldInfo π
okay so bestie, welcome to the qsqlfieldinfo manual page β it's part of the Qt docs, section 3qt, and it's genuinely one of the cutest little classes in the whole database corner of Qt. it does one job and it does it flawlessly. let's get into it. π«Άβ¨
β¨ NAME β¨
QSqlFieldInfo β stores meta data associated with a SQL field.
(yes, "meta data" as two words, that's the house style, we respect it π )
πΈ SYNOPSIS πΈ
#include <qsqlfield.h>
π Public Members
QSqlFieldInfo ( const QString & name = QString::null, QVariant::Type typ
= QVariant::Invalid, int required = -1, int len = -1, int prec = -1,
const QVariant & defValue = QVariant ( ), int typeID = 0, bool
generated = TRUE, bool trim = FALSE, bool calculated = FALSE )
QSqlFieldInfo ( const QSqlFieldInfo & other )
QSqlFieldInfo ( const QSqlField & other, bool generated = TRUE )
virtual ~QSqlFieldInfo ()
QSqlFieldInfo & operator= ( const QSqlFieldInfo & other )
bool operator== ( const QSqlFieldInfo & f ) const
QSqlField toField () const
int isRequired () const
QVariant::Type type () const
int length () const
int precision () const
QVariant defaultValue () const
QString name () const
int typeID () const
bool isGenerated () const
bool isTrim () const
bool isCalculated () const
virtual void setTrim ( bool trim )
virtual void setGenerated ( bool gen )
virtual void setCalculated ( bool calc )
π¦ DESCRIPTION π¦
the QSqlFieldInfo class stores meta data associated with a SQL field. that's the whole vibe. it's the about page, not the content.
QSqlFieldInfo objects only store meta data β the actual field values live in QSqlField objects. two different girls, two different jobs, no overlap. π
every value has to be set in the constructor (there's no "oh I'll set it later", the constructor is the moment), and then you can get them back out with isRequired(), type(), length(), precision(), defaultValue(), name(), isGenerated() and typeID().
See also: Database Classes. π
π MEMBER FUNCTION DOCUMENTATION π
QSqlFieldInfo::QSqlFieldInfo ( const QString & name = QString::null, QVariant::Type typ = QVariant::Invalid, int required = -1, int len = -1, int prec = -1, const QVariant & defValue = QVariant ( ), int typeID = 0, bool generated = TRUE, bool trim = FALSE, bool calculated = FALSE )
constructs a QSqlFieldInfo with the following parameters: <center>.nf </center>
π not me pointing out that the original docs literally just leave a dangling <center>.nf </center> markup fragment right there instead of the parameter list. it's giving "unfinished homework". i'm reporting it faithfully, that's my job, i don't make the rules.
QSqlFieldInfo::QSqlFieldInfo ( const QSqlFieldInfo & other )
constructs a copy of other. a little twin. π―
QSqlFieldInfo::QSqlFieldInfo ( const QSqlField & other, bool generated = TRUE )
creates a QSqlFieldInfo object with the type and the name of the QSqlField other. if generated is TRUE this field will be included in auto-generated SQL statments, e.g. in QSqlCursor.
QSqlFieldInfo::~QSqlFieldInfo () [virtual]
destroys the object and frees any allocated resources. she's done, she's resting, she earned it. π
QVariant QSqlFieldInfo::defaultValue () const
returns the field's default value, or an empty QVariant if the field has no default value or if the value couldn't be determined. reminder: the default value is the value that gets inserted into the database when the user doesn't explicitly specify one. it's the "if you don't pick, the database picks" option. β
bool QSqlFieldInfo::isCalculated () const
returns TRUE if the field is calculated; otherwise returns FALSE.
See also: setCalculated(). πΈ
bool QSqlFieldInfo::isGenerated () const
returns TRUE if the field should be included in auto-generated SQL statments, e.g. in QSqlCursor; otherwise returns FALSE.
See also: setGenerated(). πΈ
int QSqlFieldInfo::isRequired () const
returns a value greater than 0 if the field is required (NULL values are not allowed), 0 if it isn't required (NULL values are allowed), or less than 0 if it cannot be determined whether the field is required or not. three possible moods, bestie. π₯
bool QSqlFieldInfo::isTrim () const
returns TRUE if trailing whitespace should be removed from character fields; otherwise returns FALSE.
See also: setTrim(). πΈ
int QSqlFieldInfo::length () const
returns the field's length. for fields storing text, the return value is the maximum number of characters the field can hold. for non-character fields, some database systems return the number of bytes needed or the number of digits allowed. if the length cannot be determined, -1 is returned. so basically: it depends, and when in doubt, it's -1. π
QString QSqlFieldInfo::name () const
returns the name of the field in the SQL table.
Examples:
π§ literally nothing follows that heading in the original. an empty Examples: section. iconic behaviour, no notes, just vibes. π
QSqlFieldInfo & QSqlFieldInfo::operator= ( const QSqlFieldInfo & other )
assigns other to this field info and returns a reference to it.
bool QSqlFieldInfo::operator== ( const QSqlFieldInfo & f ) const
returns TRUE if this fieldinfo is equal to f; otherwise returns FALSE.
two field infos are considered equal if all their attributes match. all of them. every single one. it's giving "we're not the same person just because we have the same name". π
int QSqlFieldInfo::precision () const
returns the field's precision, or -1 if the field has no precision or it cannot be determined.
void QSqlFieldInfo::setCalculated ( bool calc ) [virtual]
calc set to TRUE indicates that this field is a calculated field. the value of calculated fields can by modified by subclassing QSqlCursor and overriding QSqlCursor::calculateField().
See also: isCalculated(). πΈ
void QSqlFieldInfo::setGenerated ( bool gen ) [virtual]
gen set to FALSE indicates that this field should not appear in auto-generated SQL statements (for example in QSqlCursor).
See also: isGenerated(). πΈ
void QSqlFieldInfo::setTrim ( bool trim ) [virtual]
if trim is TRUE, widgets should remove trailing whitespace from character fields. this does not affect the field value β only its representation inside widgets. so the data stays the same, it just looks cuter on screen. β¨
See also: isTrim(). πΈ
QSqlField QSqlFieldInfo::toField () const
returns an empty QSqlField based on the information in this QSqlFieldInfo.
QVariant::Type QSqlFieldInfo::type () const
returns the field's type, or QVariant::Invalid if the type is unknown.
int QSqlFieldInfo::typeID () const
returns the internal type identifier as returned from the database system. the return value is 0 if the type is unknown.
β οΈ Warning: this information is only useful for low-level database programming and is not database independent. don't build your whole personality on it, bestie. π¨
π SEE ALSO π
π COPYRIGHT π
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. π
βοΈ AUTHOR βοΈ
Generated automatically from the source code. (a robot wrote it. a legend either way.) π€π
π BUGS π
if you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. good bug reports help us to help you. thank you. π«Ά
the definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. this man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech.
if you find errors in this manual page, please report them to qt-bugs@trolltech.com. please include the name of the manual page (qsqlfieldinfo.3qt) and the Qt version (3.3.8). thank youuuu, you're doing amazing sweetie. πΈ
aaaand that's the whole page, bestie!! π this absolute icon of a man page was brought to you by Trolltech AS, dated 2 February 2007, and it's the QSqlFieldInfo(3qt) page from the Qt 3.3.8 docs. go forth and store your meta data. slay. π
β¨ππ¦
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms