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

\qmlenum should support overriding the prefix for the \value entries

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.10.0
    • Build tools: qdoc
    • All
    • DaVinci 128

      \qmlenum is the most recent additions to qdoc, enabling authors to document enums in QML. The problem though is that the command automatically adds the prefix to the \value entries based on the type info. in the argument to \qmlenum. In most cases, this is sufficient and works well, but for example, the following command documents the `Weight` enum for the `font` value type:

      /*!
          \qmlenum font::Weight
          \brief Provides a list of font weights to choose from.
      
          \value Thin        100
          \value ExtraLight  200
          \value Light       300
          \value Normal      400
          \value Medium      500
          \value DemiBold    600
          \value Bold        700
          \value ExtraBold   800
          \value Black       900
      */
      

      In this snippet, note that `font` is the type name, so qdoc adds this as prefix for all the \value entries in the comment block. In this case though, the prefix should be title case, `Font`. At the moment, there's is no way to override this unless I document `Font` as another \qmltype or \qmlvaluetype, and then document the enumeration as `\qmlenum Font::Weight`.

      If I were to copy the \value entries from an existing C++ enumerator documentation, I could use the \qmlenumeratorsfrom command, which lets me override the prefix. We need a similar solution for \qmlenum too.

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

            treinio Topi Reiniƶ
            veshivas Venugopal Shivashankar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes