1QSqlFieldInfo(3qt)                                          QSqlFieldInfo(3qt)
2
3
4

NAME

6       QSqlFieldInfo - Stores meta data associated with a SQL field
7

SYNOPSIS

9       #include <qsqlfield.h>
10
11   Public Members
12       QSqlFieldInfo ( const QString & name = QString::null, QVariant::Type
13           typ = QVariant::Invalid, int required = -1, int len = -1, int prec
14           = -1, const QVariant & defValue = QVariant ( ), int typeID = 0,
15           bool generated = TRUE, bool trim = FALSE, bool calculated = FALSE )
16       QSqlFieldInfo ( const QSqlFieldInfo & other )
17       QSqlFieldInfo ( const QSqlField & other, bool generated = TRUE )
18       virtual ~QSqlFieldInfo ()
19       QSqlFieldInfo & operator= ( const QSqlFieldInfo & other )
20       bool operator== ( const QSqlFieldInfo & f ) const
21       QSqlField toField () const
22       int isRequired () const
23       QVariant::Type type () const
24       int length () const
25       int precision () const
26       QVariant defaultValue () const
27       QString name () const
28       int typeID () const
29       bool isGenerated () const
30       bool isTrim () const
31       bool isCalculated () const
32       virtual void setTrim ( bool trim )
33       virtual void setGenerated ( bool gen )
34       virtual void setCalculated ( bool calc )
35

DESCRIPTION

37       The QSqlFieldInfo class stores meta data associated with a SQL field.
38
39       QSqlFieldInfo objects only store meta data; field values are stored in
40       QSqlField objects.
41
42       All values must be set in the constructor, and may be retrieved using
43       isRequired(), type(), length(), precision(), defaultValue(), name(),
44       isGenerated() and typeID().
45
46       See also Database Classes.
47

MEMBER FUNCTION DOCUMENTATION

QSqlFieldInfo::QSqlFieldInfo ( const QString & name = QString::null,

50       QVariant::Type typ = QVariant::Invalid, int required = -1, int len =
51       -1, int prec = -1, const QVariant & defValue = QVariant ( ), int typeID
52       = 0, bool generated = TRUE, bool trim = FALSE, bool calculated = FALSE
53       )
54       Constructs a QSqlFieldInfo with the following parameters: <center>.nf
55
56       </center>
57

QSqlFieldInfo::QSqlFieldInfo ( const QSqlFieldInfo & other )

59       Constructs a copy of other.
60

QSqlFieldInfo::QSqlFieldInfo ( const QSqlField & other, bool generated = TRUE

62       )
63       Creates a QSqlFieldInfo object with the type and the name of the
64       QSqlField other. If generated is TRUE this field will be included in
65       auto-generated SQL statments, e.g. in QSqlCursor.
66

QSqlFieldInfo::~QSqlFieldInfo () [virtual]

68       Destroys the object and frees any allocated resources.
69

QVariant QSqlFieldInfo::defaultValue () const

71       Returns the field's default value or an empty QVariant if the field has
72       no default value or the value couldn't be determined. The default value
73       is the value inserted in the database when it is not explicitly
74       specified by the user.
75

bool QSqlFieldInfo::isCalculated () const

77       Returns TRUE if the field is calculated; otherwise returns FALSE.
78
79       See also setCalculated().
80

bool QSqlFieldInfo::isGenerated () const

82       Returns TRUE if the field should be included in auto-generated SQL
83       statments, e.g. in QSqlCursor; otherwise returns FALSE.
84
85       See also setGenerated().
86

int QSqlFieldInfo::isRequired () const

88       Returns a value greater than 0 if the field is required (NULL values
89       are not allowed), 0 if it isn't required (NULL values are allowed) or
90       less than 0 if it cannot be determined whether the field is required or
91       not.
92

bool QSqlFieldInfo::isTrim () const

94       Returns TRUE if trailing whitespace should be removed from character
95       fields; otherwise returns FALSE.
96
97       See also setTrim().
98

int QSqlFieldInfo::length () const

100       Returns the field's length. For fields storing text the return value is
101       the maximum number of characters the field can hold. For non-character
102       fields some database systems return the number of bytes needed or the
103       number of digits allowed. If the length cannot be determined -1 is
104       returned.
105

QString QSqlFieldInfo::name () const

107       Returns the name of the field in the SQL table.
108
109       Examples:
110

QSqlFieldInfo & QSqlFieldInfo::operator= ( const QSqlFieldInfo & other )

112       Assigns other to this field info and returns a reference to it.
113

bool QSqlFieldInfo::operator== ( const QSqlFieldInfo & f ) const

115       Returns TRUE if this fieldinfo is equal to f; otherwise returns FALSE.
116
117       Two field infos are considered equal if all their attributes match.
118

int QSqlFieldInfo::precision () const

120       Returns the field's precision or -1 if the field has no precision or it
121       cannot be determined.
122

void QSqlFieldInfo::setCalculated ( bool calc ) [virtual]

124       calc set to TRUE indicates that this field is a calculated field. The
125       value of calculated fields can by modified by subclassing QSqlCursor
126       and overriding QSqlCursor::calculateField().
127
128       See also isCalculated().
129

void QSqlFieldInfo::setGenerated ( bool gen ) [virtual]

131       gen set to FALSE indicates that this field should not appear in auto-
132       generated SQL statements (for example in QSqlCursor).
133
134       See also isGenerated().
135

void QSqlFieldInfo::setTrim ( bool trim ) [virtual]

137       If trim is TRUE widgets should remove trailing whitespace from
138       character fields. This does not affect the field value but only its
139       representation inside widgets.
140
141       See also isTrim().
142

QSqlField QSqlFieldInfo::toField () const

144       Returns an empty QSqlField based on the information in this
145       QSqlFieldInfo.
146

QVariant::Type QSqlFieldInfo::type () const

148       Returns the field's type or QVariant::Invalid if the type is unknown.
149

int QSqlFieldInfo::typeID () const

151       Returns the internal type identifier as returned from the database
152       system. The return value is 0 if the type is unknown.
153
154       Warning: This information is only useful for low-level database
155       programming and is not database independent.
156
157

SEE ALSO

159       http://doc.trolltech.com/qsqlfieldinfo.html
160       http://www.trolltech.com/faq/tech.html
161
163       Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
164       license file included in the distribution for a complete license
165       statement.
166

AUTHOR

168       Generated automatically from the source code.
169

BUGS

171       If you find a bug in Qt, please report it as described in
172       http://doc.trolltech.com/bughowto.html.  Good bug reports help us to
173       help you. Thank you.
174
175       The definitive Qt documentation is provided in HTML format; it is
176       located at $QTDIR/doc/html and can be read using Qt Assistant or with a
177       web browser. This man page is provided as a convenience for those users
178       who prefer man pages, although this format is not officially supported
179       by Trolltech.
180
181       If you find errors in this manual page, please report them to qt-
182       bugs@trolltech.com.  Please include the name of the manual page
183       (qsqlfieldinfo.3qt) and the Qt version (3.3.8).
184
185
186
187Trolltech AS                    2 February 2007             QSqlFieldInfo(3qt)
Impressum