Eneboo - Documentación para desarrolladores
|
The QSqlEditorFactory class is used to create the editors used by QDataTable and QSqlForm. Más...
#include <qsqleditorfactory.h>
Métodos públicos | |
QSqlEditorFactory (QObject *parent=0, const char *name=0) | |
~QSqlEditorFactory () | |
virtual QWidget * | createEditor (QWidget *parent, const QVariant &variant) |
virtual QWidget * | createEditor (QWidget *parent, const QSqlField *field) |
QSqlEditorFactory (QObject *parent=0, const char *name=0) | |
~QSqlEditorFactory () | |
virtual QWidget * | createEditor (QWidget *parent, const QVariant &variant) |
virtual QWidget * | createEditor (QWidget *parent, const QSqlField *field) |
Métodos públicos estáticos | |
static QSqlEditorFactory * | defaultFactory () |
static void | installDefaultFactory (QSqlEditorFactory *factory) |
static QSqlEditorFactory * | defaultFactory () |
static void | installDefaultFactory (QSqlEditorFactory *factory) |
The QSqlEditorFactory class is used to create the editors used by QDataTable and QSqlForm.
sql
QSqlEditorFactory is used by QDataTable and QSqlForm to automatically create appropriate editors for a given QSqlField. For example if the field is a QVariant::String a QLineEdit would be the default editor, whereas a QVariant::Int's default editor would be a QSpinBox.
If you want to create different editors for fields with the same data type, subclass QSqlEditorFactory and reimplement the createEditor() function.
QSqlEditorFactory::QSqlEditorFactory | ( | QObject * | parent = 0 , |
const char * | name = 0 |
||
) |
Constructs a SQL editor factory with parent parent, called name.
QSqlEditorFactory::~QSqlEditorFactory | ( | ) |
Destroys the object and frees any allocated resources.
QSqlEditorFactory::QSqlEditorFactory | ( | QObject * | parent = 0 , |
const char * | name = 0 |
||
) |
QSqlEditorFactory::~QSqlEditorFactory | ( | ) |
Creates and returns the appropriate editor widget for the QVariant variant.
The widget that is returned has the parent parent (which may be zero). If variant is invalid, 0 is returned.
Reimplementado de QEditorFactory.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Creates and returns the appropriate editor for the QSqlField field.
Creates and returns the appropriate editor for the QVariant v. If the QVariant is invalid, 0 is returned. The parent is passed to the appropriate editor's constructor.
Reimplementado de QEditorFactory.
virtual QWidget* QSqlEditorFactory::createEditor | ( | QWidget * | parent, |
const QSqlField * | field | ||
) | [virtual] |
static QSqlEditorFactory* QSqlEditorFactory::defaultFactory | ( | ) | [static] |
Returns an instance of a default editor factory.
Reimplementado de QEditorFactory.
QSqlEditorFactory * QSqlEditorFactory::defaultFactory | ( | ) | [static] |
Returns an instance of a default editor factory.
Reimplementado de QEditorFactory.
void QSqlEditorFactory::installDefaultFactory | ( | QSqlEditorFactory * | factory | ) | [static] |
Replaces the default editor factory with factory. All QDataTable and QSqlForm instantiations will use this new factory for creating field editors. {QSqlEditorFactory takes ownership of factory, and destroys it when it is no longer needed.}
static void QSqlEditorFactory::installDefaultFactory | ( | QSqlEditorFactory * | factory | ) | [static] |