Hi,
the Color Editor Factory example from the QT Documentation shows how to use the ColorListEditor as the default editor for a data from type QVariant::Color.
I noticed that by using the code from this example, the already existing default editors for a variety of data types (bool, double, int, QString,....) are not available anymore as the new created factory will contain ONLY the editor for the type QVariant::Color.
factory
->registerEditor
(QVariant::Color, colorListCreator
);
QItemEditorFactory *factory = new QItemEditorFactory;
QItemEditorCreatorBase *colorListCreator = new QStandardItemEditorCreator<ColorListEditor>();
factory->registerEditor(QVariant::Color, colorListCreator);
QItemEditorFactory::setDefaultFactory(factory);
To copy to clipboard, switch view to plain text mode
So I would like to know if this is the correct way to actually add the ColorListEditor to the already existing list of editors:
factory
->registerEditor
(QVariant::Color, colorListCreator
);
QItemEditorFactory *factory = (QItemEditorFactory *)QItemEditorFactory::defaultFactory();
QItemEditorCreatorBase *colorListCreator = new QStandardItemEditorCreator<ColorListEditor>();
factory->registerEditor(QVariant::Color, colorListCreator);
QItemEditorFactory::setDefaultFactory(factory);
To copy to clipboard, switch view to plain text mode
Bookmarks