You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qt3/doc/man/man3/qdataview.3qt

130 lines
4.8 KiB

'\" 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).