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

Add better API for creating editors with custom metatypes

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 4.3.1
    • Fix Version/s: Some future release
    • Component/s: Widgets: Itemviews
    • Labels:
      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'.

        Attachments

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

          Activity

            People

            Assignee:
            stephen.kelly Stephen Kelly (Unused account) (Inactive)
            Reporter:
            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