Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

Q3SqlForm Class Reference

Inheritance diagram for Q3SqlForm:


List of all members.

Detailed Description

The Q3SqlForm class creates and manages data entry forms tied to SQL databases.

Typical use of a Q3SqlForm consists of the following steps: Create the widgets you want to appear in the form. Create a cursor and navigate to the record to be edited. Create the Q3SqlForm. Set the form's record buffer to the cursor's update buffer. Insert each widget and the field it is to edit into the form. Use readFields() to update the editor widgets with values from the database's fields. Display the form and let the user edit values etc. Use writeFields() to update the database's field values with the values in the editor widgets.

Note that a Q3SqlForm does not access the database directly, but most often via QSqlFields which are part of a Q3SqlCursor. A Q3SqlCursor::insert(), Q3SqlCursor::update() or Q3SqlCursor::del() call is needed to actually write values to the database.

Some sample code to initialize a form successfully:

doc/src/snippets/code/src_qt3support_sql_q3sqlform.cpp 0

If you want to use custom editors for displaying and editing data fields, you must install a custom Q3SqlPropertyMap. The form uses this object to get or set the value of a widget.

See also:
installPropertyMap(), Q3SqlPropertyMap

Definition at line 59 of file q3sqlform.h.

Public Slots

virtual void clear ()
virtual void clearValues ()
void deleteLater ()
virtual void readField (QWidget *widget)
virtual void readFields ()
virtual void writeField (QWidget *widget)
virtual void writeFields ()


void destroyed (QObject *=0)

Public Member Functions

bool blockSignals (bool b)
const QObjectListchildren () const
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
int count () const
bool disconnect (const QObject *receiver, const char *member=0)
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
void dumpObjectInfo ()
void dumpObjectTree ()
QList< QByteArraydynamicPropertyNames () const
virtual bool event (QEvent *)
virtual bool eventFilter (QObject *, QEvent *)
QWidgetfieldToWidget (QSqlField *field) const
template<typename T>
findChild (const QString &aName=QString()) const
template<typename T>
QList< T > findChildren (const QRegExp &re) const
template<typename T>
QList< T > findChildren (const QString &aName=QString()) const
bool inherits (const char *classname) const
virtual void insert (QWidget *widget, const QString &field)
void installEventFilter (QObject *)
void installPropertyMap (Q3SqlPropertyMap *map)
bool isWidgetType () const
void killTimer (int id)
void moveToThread (QThread *thread)
QString objectName () const
QObjectparent () const
QVariant property (const char *name) const
 Q3SqlForm (QObject *parent=0)
virtual void remove (const QString &field)
void removeEventFilter (QObject *)
void setObjectName (const QString &name)
void setParent (QObject *)
bool setProperty (const char *name, const QVariant &value)
virtual void setRecord (QSqlRecord *buf)
void setUserData (uint id, QObjectUserData *data)
bool signalsBlocked () const
int startTimer (int interval)
QThreadthread () const
QObjectUserData * userData (uint id) const
QWidgetwidget (int i) const
QSqlFieldwidgetToField (QWidget *widget) const
 ~Q3SqlForm ()

Static Public Member Functions

static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
static uint registerUserData ()

Protected Member Functions

virtual void childEvent (QChildEvent *)
void clearMap ()
virtual void connectNotify (const char *signal)
virtual void customEvent (QEvent *)
virtual void disconnectNotify (const char *signal)
virtual void insert (QWidget *widget, QSqlField *field)
int receivers (const char *signal) const
virtual void remove (QWidget *widget)
QObjectsender () const
virtual void timerEvent (QTimerEvent *)

Protected Attributes

QObjectData * d_ptr

Static Protected Attributes

static const QMetaObject staticQtMetaObject


QString objectName
 the name of this object

Private Member Functions

virtual void sync ()

Private Attributes

Q3SqlFormPrivate * d


class QApplication
class QApplicationPrivate
class QCoreApplication
class QCoreApplicationPrivate
struct QMetaObject
class QThreadData
class QWidget

Related Functions

(Note that these are not member functions.)

qFindChild (const QObject *obj, const QString &name=QString(), T dummy=0)
qFindChild (const QObject *obj, const QString &name)
QList< T > qFindChildren (const QObject *obj, const QString &name=QString(), T dummy=0)
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
QList< T > qFindChildren (const QObject *obj, const QString &name)
T * qobject_cast (QObject *object)
void * qt_find_obj_child (QObject *parent, const char *type, const QString &name)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index