Q3SqlForm Class | Qt 4.8 (original) (raw)
The Q3SqlForm class creates and manages data entry forms tied to SQL databases. More...
Member Function Documentation
Q3SqlForm::Q3SqlForm(QObject * parent = 0)
Constructs a Q3SqlForm with parent parent.
Q3SqlForm::~Q3SqlForm()
Destroys the object and frees any allocated resources.
[virtual slot] void Q3SqlForm::clear()
Removes every widget, and the fields they're mapped to, from the form.
[virtual slot] void Q3SqlForm::clearValues()
Clears the values in all the widgets, and the fields they are mapped to, in the form, and sets them to NULL.
int Q3SqlForm::count() const
Returns the number of widgets in the form.
QWidget * Q3SqlForm::fieldToWidget(QSqlField * field) const
Returns the widget that field field is mapped to.
[virtual] void Q3SqlForm::insert(QWidget * widget, const QString & field)
Inserts a widget, and the name of the field it is to be mapped to, into the form. To actually associate inserted widgets with an edit buffer, use setRecord().
See also setRecord().
[virtual protected] void Q3SqlForm::insert(QWidget * widget, QSqlField * field)
This is an overloaded function.
Inserts a widget, and the field it is to be mapped to, into the form.
void Q3SqlForm::installPropertyMap(Q3SqlPropertyMap * pmap)
Installs a custom Q3SqlPropertyMap. This is useful if you plan to create your own custom editor widgets.
Q3SqlForm takes ownership of pmap, so pmap is deleted when Q3SqlForm goes out of scope.
See also Q3DataTable::installEditorFactory().
[virtual slot] void Q3SqlForm::readField(QWidget * widget)
Updates the widget widget with the value from the SQL field it is mapped to. Nothing happens if no SQL field is mapped to the widget.
[virtual slot] void Q3SqlForm::readFields()
Updates the widgets in the form with current values from the SQL fields they are mapped to.
[virtual protected] void Q3SqlForm::remove(QWidget * widget)
Removes a widget, and hence the field it's mapped to, from the form.
[virtual] void Q3SqlForm::remove(const QString & field)
This is an overloaded function.
Removes field from the form.
[virtual] void Q3SqlForm::setRecord(QSqlRecord * buf)
Sets buf as the record buffer for the form. To force the display of the data from buf, use readFields().
See also readFields() and writeFields().
QWidget * Q3SqlForm::widget(int i) const
Returns the _i_-th widget in the form. Useful for traversing the widgets in the form.
QSqlField * Q3SqlForm::widgetToField(QWidget * widget) const
Returns the SQL field that widget widget is mapped to.
[virtual slot] void Q3SqlForm::writeField(QWidget * widget)
Updates the SQL field with the value from the widget it is mapped to. Nothing happens if no SQL field is mapped to the widget.
[virtual slot] void Q3SqlForm::writeFields()
Updates the SQL fields with values from the widgets they are mapped to. To actually update the database with the contents of the record buffer, use Q3SqlCursor::insert(), Q3SqlCursor::update() or Q3SqlCursor::del() as appropriate.