QDataView(3qt)
๐ QDataView(3qt) โ bestie edition ๐
okay so this is the man page for QDataView, from the Qt 3 era (the page itself is qdataview.3qt), and honestly? she's a whole vibe. read-only, low-maintenance, doesn't need much. let's get into it ๐ซถ
โจ NAME โจ
QDataView โ Read-only SQL forms ๐
๐ธ SYNOPSIS ๐ธ
#include <qdataview.h>
Inherits QWidget. yep, she's a widget, she's in the family tree ๐
๐ Public Members ๐
QDataView ( QWidget * parent = 0, const char * name = 0, WFlags fl = 0 )~QDataView ()virtual void setForm ( QSqlForm * form )QSqlForm * form ()virtual void setRecord ( QSqlRecord * record )QSqlRecord * record ()
๐ Public Slots ๐
virtual void refresh ( QSqlRecord * buf )virtual void readFields ()virtual void writeFields ()virtual void clearValues ()
๐ฆ DESCRIPTION ๐ฆ
So the QDataView class provides read-only SQL forms. that's the whole personality. no editing, no drama.
This class gives you a form that displays SQL field data from a record buffer. and here's the slay: because QDataView doesn't support editing, it uses less resources than a QDataBrowser does. so if all you're doing is showing read-only data from a SQL database, this is literally the one. it's giving minimal, it's giving efficient, it's giving main character energy for display-only workloads โจ
okay but if you want a form you can actually edit? go use QDataBrowser. and if you want your data presented as a table? that's QDataTable. different girls, different jobs, no competition ๐
The form gets associated with the data view via setForm(), and the record gets associated via setRecord(). you can also just hand a QSqlRecord straight to the refresh() function โ that'll set the record to the given record and read the record's fields into the form. two birds, one function, iconic ๐
See also Database Classes.
๐ MEMBER FUNCTION DOCUMENTATION ๐
QDataView::QDataView ( QWidget * parent = 0, const char * name = 0, WFlags fl = 0 )
Constructs a data view which is a child of parent, called name, and with widget flags fl. newborn data view, so cute ๐ผ
QDataView::~QDataView ()
Destroys the object and frees any allocated resources. she's done, she's resting, she earned it ๐
void QDataView::clearValues () [virtual slot]
Clears the default form's values. If there is no default form, nothing happens. and every value gets set to its 'zero state' โ like 0 for numeric fields, "" for string fields. factory reset but make it SQL ๐
QSqlForm * QDataView::form ()
Returns the default form used by the data view, or 0 if there is none. no form, no problem, you just get a lil 0 ๐ซถ
See also setForm().
void QDataView::readFields () [virtual slot]
Causes the default form to read its fields from the record buffer. If there is no default form, or no record, nothing happens. like, she's not gonna make up data for you bestie, that's not her job ๐ญ
See also setForm().
QSqlRecord * QDataView::record ()
Returns the default record used by the data view, or 0 if there is none. empty-handed? you get a 0. periodt.
See also setRecord().
void QDataView::refresh ( QSqlRecord * buf ) [virtual slot]
Causes the default form to display the contents of buf. If there is no default form, nothing happens.
and heads up: buf also becomes the default record for all subsequent calls to readFields() and writefields(). so she's not just borrowing it for a sec, she's keeping it ๐
This slot is equivalant to calling:
myView.setRecord( record );
myView.readFields();
(yes the original says "equivalant", we're preserving the spelling exactly, do not come for me ๐)
See also setRecord() and readFields().
void QDataView::setForm ( QSqlForm * form ) [virtual]
Sets the form used by the data view to form. If a record has already been assigned to the data view, the form will display that record's data. she's ready when you are ๐
See also form().
void QDataView::setRecord ( QSqlRecord * record ) [virtual]
Sets the record used by the data view to record. If a form has already been assigned to the data view, the form will display the data from record in that form. matching sets, we love to see it โจ
See also record().
void QDataView::writeFields () [virtual slot]
Causes the default form to write its fields to the record buffer. If there is no default form, or no record, nothing happens. no form? no record? no writing. simple math ๐งฎ
See also setForm().
๐ 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. (yes, actually read it, don't just scroll past ๐)
โ๏ธ AUTHOR โ๏ธ
Generated automatically from the source code. no human author, just robots being efficient, we respect it ๐ค
๐ 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. (fr fr, a good bug report is a love letter to maintainers ๐ซถ)
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. so like, she's a bonus, not the canon ๐
If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qdataview.3qt) and the Qt version (3.3.8). include both, don't be shy, it helps ๐
and that's the page!! brought to you by Trolltech AS, dated 2 February 2007, man page QDataView(3qt), Qt version 3.3.8 โ mwah, take care of her, she's vintage ๐โจ๐
๐ฆ 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