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

Can't override property type in \qmlproperty

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • None
    • 6.8
    • Build tools: qdoc
    • 8bcc0e5a0 (dev), ada09a3ea (6.9), f5d6cb48b (6.8)
    • DaVinci 109, DaVinci 110

      In QML when I have a property of type alias I can specify an actual property type in the \qmlproperty command:

      /*!
          \qmlproperty int someAlias
          An alias
       */
      property alias someAlias: someInt 

      The property will be shown as int in the documentation.

      However when the property is not an alias the same doesn't work and the type as written in the code will be shown. There's a few cases in which I found myself wanting to override the automatic type.

      Override var with concrete type:

      /*!
          \qmlproperty int someInt
      */
      property var someInt 

      Hide an irrelevant module prefix:

      /*!
          \qmlproperty Action anAction
        
          An action
      */
      property T.Action anAction 

      Grouped properties:

      /*!
          \qmlproperty string icon.name
          \qmlproperty color icon.color
      
          A grouped property
       */
      property IconGroup icon 

      In all these cases the type as spelled in the QML code is shown, not what is passed to \qmlproperty

        For Gerrit Dashboard: QTBUG-128327
        # Subject Branch Project Status CR V

            treinio Topi Reiniö
            nicolasfella_kde Nicolas Fella
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes