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

qmlsc doesn't like uint Q_PROPERTIES

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 6.4.0 Beta1
    • Fix Version/s: 6.5
    • Component/s: QML: Compiler
    • Labels:
      None
    • Platform/s:
      All

      Description

      Given this C++ gadget class

       class QmlLot
      {
          Q_GADGET
          QML_NAMED_ELEMENT(Lot)
          QML_UNCREATABLE("")
          Q_PROPERTY(uint alternateId READ alternateId WRITE setAlternateId)
          ...
      }

      then creating a QML property

          property Lot bllot

      and accessing it:

       Warning: View.qml:226:56: Type "uint" of property "alternateId" not found. This is likely due to a missing dependency entry or a type not being exposed declaratively.
                              property color tagColor: bllot.alternateId ? "red" : "blue"
                                                             ^^^^^^^^^^^
      Error: View.qml:226:56: Could not compile binding for tagColor: Cannot load property alternateId from BrickLink::QmlLot of (component in src/mobile/View.qml)::bllot with type BrickLink::QmlLot.
                              property color tagColor: bllot.alternateId ? "red" : "blue"
                                                             ^^^^^^^^^^^
      

      s/uint/unsigned int/ in Q_PROPERTY doesn't make it any better

        Attachments

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

          Activity

            People

            Assignee:
            qtqmlteam Qt Qml Team User
            Reporter:
            rgriebl Robert Griebl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes