Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
4.3.1
-
None
Description
In the current QItemEditorFactory API, registering an editor for a custom user type that has been declared as a QMetaType (using Q_DECLARE_METATYPE) is somewhat cumbersome. The problem is that QItemEditorFactory::registerEditor() takes a QVariant::Type argument, but the exact type cannot be determined using the QVariant API. Calling 'nameToType' is not sufficient because this just returns QVariant::UserType.
A workaround is to call 'qMetaTypeId' with the data type (or QVariant::userType() with an instance) and then cast this to a 'QVariant::Type', but a better solution would be to have a registerEditor() function that took an 'int'.