Qt:Документация 4.3.2/qstandarditemeditorcreator

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь

__NOTOC__

Image:qt-logo.png

Главная · Все классы · Основные классы · Классы по группам · Модули · Функции

Image:trolltech-logo.png

Содержание

[править] QStandardItemEditorCreator Class Reference
[модуль QtGui ]

The QStandardItemEditorCreator class provides the possibility to register widgets without having to subclass QItemEditorCreatorBase. Далее...

 #include <QStandardItemEditorCreator>

Inherits QItemEditorCreatorBase.

Класс был добавлен в Qt 4.2.

[править] Открытые функции


[править] Подробное описание

The QStandardItemEditorCreator class provides the possibility to register widgets without having to subclass QItemEditorCreatorBase.

This convenience template class makes it possible to register widgets without having to subclass QItemEditorCreatorBase.

Пример:

 QItemEditorFactory *editorFactory = new QItemEditorFactory;
 QItemEditorCreatorBase *creator = new QStandardItemEditorCreator<MyFancyDateTimeEdit>();
 editorFactory->registerEditor(QVariant::DateType, creator);

Setting the editorFactory created above in an item delegate via QItemDelegate::setItemEditorFactory() makes sure that all values of type QVariant::DateTime will be edited in MyFancyDateTimeEdit.

The editor must provide a user property that will contain the editing data. The property is used by QItemDelegates to set and retrieve the data (using Qt's meta-object system). You set the user property with the USER keyword:

     Q_PROPERTY(QColor color READ color WRITE setColor USER true)

See also QItemEditorCreatorBase, QItemEditorCreator, QItemEditorFactory, QItemDelegate, and Color Editor Factory Example.


[править] Описание функций-членов

[править]
QStandardItemEditorCreator::QStandardItemEditorCreator ()

Constructs an editor creator object.



Copyright © 2007 Trolltech Trademarks
Qt 4.3.2