Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-1065

Add better API for creating editors with custom metatypes

    XMLWordPrintable

Details

    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'.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            stephen.kelly Stephen Kelly (Unused account) (Inactive)
            jabarron Jason Barron
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes