|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.gui.QItemEditorCreatorBase
public abstract class QItemEditorCreatorBase
The QItemEditorCreatorBase
class provides an abstract base class that must be subclassed when implementing new item editor creators. QItemEditorCreatorBase
objects are specialized widget factories that provide editor widgets for one particular QVariant
data type. They are used by QItemEditorFactory
to create editors for QItemDelegate
s. Creator bases must be registered with QItemEditorFactory::registerEditor()
.
An editor should provide a user property for the data it edits. QItemDelagates
can then access the property using Qt's meta-object system to set and retrieve the editing data. A property is set as the user property with the USER keyword:
Q_PROPERTY(QColor color READ color WRITE setColor USER true)If the editor does not provide a user property, it must return the name of the property from
valuePropertyName()
; delegates will then use the name to access the property. If a user property exists, item delegates will not call valuePropertyName()
. QStandardItemEditorCreator
is a convenience template class that can be used to register widgets without the need to subclass QItemEditorCreatorBase
.
QStandardItemEditorCreator
, QItemEditorFactory
, Model/View Programming, and Color Editor Factory Example.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Constructor Summary | |
---|---|
QItemEditorCreatorBase()
Creates a new QItemEditorCreatorBase |
Method Summary | |
---|---|
abstract QWidget |
createWidget(QWidget parent)
Returns an editor widget with the given parent. |
static QItemEditorCreatorBase |
fromNativePointer(QNativePointer nativePointer)
|
abstract QByteArray |
valuePropertyName()
Returns the name of the property used to get and set values in the creator's editor widgets. |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QItemEditorCreatorBase()
Method Detail |
---|
public abstract QWidget createWidget(QWidget parent)
When implementing this function in subclasses of this class, you must construct and return new editor widgets with the parent widget specified.
public abstract QByteArray valuePropertyName()
When implementing this function in subclasses, you must ensure that the editor widget's property specified by this function can accept the type the creator is registered for. For example, a creator which constructs QCheckBox
widgets to edit boolean values would return the checkable
property name from this function, and must be registered in the item editor factory for the QVariant::Bool
type.
Note: Since Qt 4.2 the item delegates query the user property of widgets, and only call this function if the widget has no user property. You can override this behavior by reimplementing QAbstractItemDelegate::setModelData()
and QAbstractItemDelegate::setEditorData()
.
QItemEditorFactory::registerEditor()
.
public static QItemEditorCreatorBase fromNativePointer(QNativePointer nativePointer)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |