summaryrefslogtreecommitdiffstats
path: root/doc/man/man3/qdataview.3qt
blob: 6b21b21dd7aa2795efd23c59d6ec77122e7ea27c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
'\" t
.TH QDataView 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA.  All rights reserved.  See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
QDataView \- Read-only SQL forms
.SH SYNOPSIS
\fC#include <qdataview.h>\fR
.PP
Inherits QWidget.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQDataView\fR ( QWidget * parent = 0, const char * name = 0, WFlags fl = 0 )"
.br
.ti -1c
.BI "\fB~QDataView\fR ()"
.br
.ti -1c
.BI "virtual void \fBsetForm\fR ( QSqlForm * form )"
.br
.ti -1c
.BI "QSqlForm * \fBform\fR ()"
.br
.ti -1c
.BI "virtual void \fBsetRecord\fR ( QSqlRecord * record )"
.br
.ti -1c
.BI "QSqlRecord * \fBrecord\fR ()"
.br
.in -1c
.SS "Public Slots"
.in +1c
.ti -1c
.BI "virtual void \fBrefresh\fR ( QSqlRecord * buf )"
.br
.ti -1c
.BI "virtual void \fBreadFields\fR ()"
.br
.ti -1c
.BI "virtual void \fBwriteFields\fR ()"
.br
.ti -1c
.BI "virtual void \fBclearValues\fR ()"
.br
.in -1c
.SH DESCRIPTION
The QDataView class provides read-only SQL forms.
.PP
This class provides a form which displays SQL field data from a record buffer. Because QDataView does not support editing it uses less resources than a QDataBrowser. This class is well suited for displaying read-only data from a SQL database.
.PP
If you want a to present your data in an editable form use QDataBrowser; if you want a table-based presentation of your data use QDataTable.
.PP
The form is associated with the data view with setForm() and the record is associated with setRecord(). You can also pass a QSqlRecord to the refresh() function which will set the record to the given record and read the record's fields into the form.
.PP
See also Database Classes.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QDataView::QDataView ( QWidget * parent = 0, const char * name = 0, WFlags fl = 0 )"
Constructs a data view which is a child of \fIparent\fR, called \fIname\fR, and with widget flags \fIfl\fR.
.SH "QDataView::~QDataView ()"
Destroys the object and frees any allocated resources.
.SH "void QDataView::clearValues ()\fC [virtual slot]\fR"
Clears the default form's values. If there is no default form, nothing happens. All the values are set to their 'zero state', e.g. 0 for numeric fields, "" for string fields.
.SH "QSqlForm * QDataView::form ()"
Returns the default form used by the data view, or 0 if there is none.
.PP
See also setForm().
.SH "void QDataView::readFields ()\fC [virtual slot]\fR"
Causes the default form to read its fields from the record buffer. If there is no default form, or no record, nothing happens.
.PP
See also setForm().
.SH "QSqlRecord * QDataView::record ()"
Returns the default record used by the data view, or 0 if there is none.
.PP
See also setRecord().
.SH "void QDataView::refresh ( QSqlRecord * buf )\fC [virtual slot]\fR"
Causes the default form to display the contents of \fIbuf\fR. If there is no default form, nothing happens.The \fIbuf\fR also becomes the default record for all subsequent calls to readFields() and writefields(). This slot is equivalant to calling:
.PP
.nf
.br
    myView.setRecord( record );
.br
    myView.readFields();
.br
.fi
.PP
See also setRecord() and readFields().
.SH "void QDataView::setForm ( QSqlForm * form )\fC [virtual]\fR"
Sets the form used by the data view to \fIform\fR. If a record has already been assigned to the data view, the form will display that record's data.
.PP
See also form().
.SH "void QDataView::setRecord ( QSqlRecord * record )\fC [virtual]\fR"
Sets the record used by the data view to \fIrecord\fR. If a form has already been assigned to the data view, the form will display the data from \fIrecord\fR in that form.
.PP
See also record().
.SH "void QDataView::writeFields ()\fC [virtual slot]\fR"
Causes the default form to write its fields to the record buffer. If there is no default form, or no record, nothing happens.
.PP
See also setForm().

.SH "SEE ALSO"
.BR http://doc.trolltech.com/qdataview.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
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. 
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (qdataview.3qt) and the Qt
version (3.3.8).