Q3DataView Class

The Q3DataView class provides read-only SQL forms. More...

Header: #include <Q3DataView>
Inherits: QWidget

Public Functions

Q3DataView(QWidget * parent = 0, const char * name = 0, Qt::WindowFlags fl = 0)
~Q3DataView()
Q3SqlForm * form()
QSqlRecord * record()
virtual void setForm(Q3SqlForm * form)
virtual void setRecord(QSqlRecord * record)
  • 220 public functions inherited from QWidget
  • 29 public functions inherited from QObject
  • 12 public functions inherited from QPaintDevice

Public Slots

virtual void clearValues()
virtual void readFields()
virtual void refresh(QSqlRecord * buf)
virtual void writeFields()
  • 19 public slots inherited from QWidget
  • 1 public slot inherited from QObject

Additional Inherited Members

  • 58 properties inherited from QWidget
  • 1 property inherited from QObject
  • 1 signal inherited from QWidget
  • 1 signal inherited from QObject
  • 4 static public members inherited from QWidget
  • 7 static public members inherited from QObject
  • 37 protected functions inherited from QWidget
  • 8 protected functions inherited from QObject
  • 1 protected function inherited from QPaintDevice
  • 1 protected slot inherited from QWidget

Detailed Description

The Q3DataView class provides read-only SQL forms.

This class provides a form which displays SQL field data from a record buffer. Because Q3DataView does not support editing it uses less resources than a Q3DataBrowser. This class is well suited for displaying read-only data from a SQL database.

If you want a to present your data in an editable form use Q3DataBrowser; if you want a table-based presentation of your data use Q3DataTable.

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.

Member Function Documentation

Q3DataView::Q3DataView(QWidget * parent = 0, const char * name = 0, Qt::WindowFlags fl = 0)

Constructs a data view which is a child of parent, called name, and with widget flags fl.

Q3DataView::~Q3DataView()

Destroys the object and frees any allocated resources.

[virtual slot] void Q3DataView::clearValues()

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.

Q3SqlForm * Q3DataView::form()

Returns the default form used by the data view, or 0 if there is none.

See also setForm().

[virtual slot] void Q3DataView::readFields()

Causes the default form to read its fields from the record buffer. If there is no default form, or no record, nothing happens.

See also setForm().

QSqlRecord * Q3DataView::record()

Returns the default record used by the data view, or 0 if there is none.

See also setRecord().

[virtual slot] void Q3DataView::refresh(QSqlRecord * buf)

Causes the default form to display the contents of buf. If there is no default form, nothing happens.The buf also becomes the default record for all subsequent calls to readFields() and writefields(). This slot is equivalant to calling:

myView.setRecord(record);
myView.readFields();

See also setRecord() and readFields().

[virtual] void Q3DataView::setForm(Q3SqlForm * form)

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.

See also form().

[virtual] void Q3DataView::setRecord(QSqlRecord * record)

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.

See also record().

[virtual slot] void Q3DataView::writeFields()

Causes the default form to write its fields to the record buffer. If there is no default form, or no record, nothing happens.

See also setForm().

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.