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

QVariant properties of value types are not accessible from QML

XMLWordPrintable

    • afbfdcff3b3cd14f16736b7c84e04fe9ad61ef8d

      If I expose a value type to QML using Q_GADGET, QVariant properties of the new type are not accessible from QML. Properties of other types work fine, and QVariant properties of QObject types work correctly.

      I've attached a test case that demonstrates this.

      This appears to be because QQmlValueTypeWrapper::get wraps the QVariant property value in a QVariant before passing it to QV4::ExecutionEngine::fromVariant, which doesn't handle this case. Indeed, the value of the property appears to be converted to a QV4::VariantObject in the engine.

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

            erikv Erik Verbruggen
            chrisccoulson Chris Coulson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes