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

QML enum documentation should make a greater distinction between using enums declared in C++ and declaring enums in QML

    XMLWordPrintable

    Details

      Description

      https://doc.qt.io/qt-6/qml-enumeration.html talks about using enums declared in C++. At the very bottom, there is a vague link that says "Enumeration Attributes" that explains how to actually declare enums in QML.

      As https://doc.qt.io/qt-6/qml-enumeration.html is the only relevant result on the first page of Google's search results, someone wanting to know how to declare enums in QML is likely going to go back to the search results and visit the Stack Overflow link before seeing the Enumeration Attributes link at the bottom:

      https://stackoverflow.com/questions/34461378/how-can-we-declare-enumerations-in-qml-without-any-javascript

      At the very beginning of the page, we should state that there are two ways to use enums, and give each approach its own section. It might even be worthwhile moving the content under https://doc.qt.io/qt-6/qtqml-syntax-objectattributes.html#enumeration-attributes to this page and just linking to this page from that one, since this one is more visible in search results.

        Attachments

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

          Activity

            People

            Assignee:
            docteam Qt Documentation Team
            Reporter:
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes