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

qmlRegisterRevision clashes with qmlRegisterUncreatableType

    XMLWordPrintable

Details

    • e76ba402bfe309022a0be29c6bc8223f8f3f94b3

    Description

      Consider the attached example (a self-contained unit test).

      The Derived class is exported to QML using qmlRegisterType. The Base class is exported to QML as an uncreatable type. However, to support REVISION 1 in the Base class, we must use qmlRegisterRevision. This fails for 2 reasons.

      1) qmlRegisterRevision requires the class to be 'creatable' (it's not)
      2) qmlRegisterRevision replaces data set by qmlRegisterUncreatableType (and vice versa)

      I'm not sure if it's feasible to change the behaviour or qmlRegisterRevision so I propose adding a new method, qmlRegisterUncreatableType<T,int> that allows setting the REVISION for an uncreatable base class.

      The attached example contains an implementation of this method that allows it to work as expected.

      Attachments

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

        Activity

          People

            martjone Martin Jones (closed Nokia identity) (Inactive)
            lramsay Lincoln Ramsay (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes