thats a very good catch! but i dont know how you are able to edit both data types when commenting setDefaultFactory()...anyways, couple of ways to resolve your issue:
1. using delegate: dont set this factory as default, just call setItemEditorFactory(QItemEditorFactory *) on QStyledItemDelegate, Qt's right hand for drawing views. thus when QVariant::Type is Color, it will create your custom editor, for all other QVariant types, it will use default factory.
2. derive from QItemEditorFactory, implement createEditor(..) in a way that if type is Color, it will use ColorEditor, otherwise it will call default factory's createEditor(..). next, set this new class as the default editor factory.
i think second one will work better for you, i.e. without interfering with any delegate.
Bookmarks