Q3EditorFactory Class

The Q3EditorFactory class is used to create editor widgets for QVariant 數據類型。 更多...

頭: #include <Q3EditorFactory>
繼承: QObject
繼承者: Q3SqlEditorFactory

公共函數

Q3EditorFactory (QObject * parent = 0)
~Q3EditorFactory ()
virtual QWidget * createEditor (QWidget * parent , const QVariant & v )

靜態公共成員

Q3EditorFactory * defaultFactory ()
void installDefaultFactory (Q3EditorFactory * factory )

額外繼承成員

詳細描述

The Q3EditorFactory class is used to create editor widgets for QVariant 數據類型。

Each editor factory provides the createEditor () function which given a QVariant will create and return a QWidget that can edit that QVariant . For example if you have a QVariant::String 類型, QLineEdit would be the default editor returned, 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 Q3EditorFactory 並重實現 createEditor () 函數。

成員函數文檔編製

Q3EditorFactory:: Q3EditorFactory ( QObject * parent = 0)

Constructs an editor factory with parent parent .

Q3EditorFactory:: ~Q3EditorFactory ()

銷毀對象並釋放任何分配資源。

[虛擬] QWidget * Q3EditorFactory:: createEditor ( QWidget * parent , const QVariant & v )

Creates and returns the appropriate editor for the QVariant v 。若 QVariant is invalid, 0 is returned. The parent is passed to the appropriate editor's constructor.

[static] Q3EditorFactory * Q3EditorFactory:: defaultFactory ()

Returns an instance of a default editor factory.

[static] void Q3EditorFactory:: installDefaultFactory ( Q3EditorFactory * factory )

Replaces the default editor factory with factory . Q3EditorFactory takes ownership of factory, and destroys it when it is no longer needed.