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

Enums declared in C++ base type

    XMLWordPrintable

    Details

    • Commits:
      b7738beda651c2927e1a9d58c592148b1dc99576

      Description

      A common problem for controls is that when the business logic is implemented in a C++ "base" type and the visual parts in a QML "sub" type, enum values provided by the C++ type cannot be accessed by the QML type name.

      Example: a TextField control that inherits QQuickTextInput.

      // TextField.qml
      TextInput {
          id: control
          implicitWidth: ...
          implicitHeight: ...
          Rectangle {
              id: background
              z: -1
          }
      }
      

      Application code cannot use eg. TextField.Password but must use TextInput.Password instead:

      TextField {
          // echoMode: TextField.Password // "ReferenceError: TextField is not defined"
          // vs.
          echoMode: TextInput.Password // :(
      }
      

        Attachments

          Issue Links

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

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jpnurmi J-P Nurmi
              • Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews Side Panel

                  Error rendering 'com.meetme.plugins.jira.gerrit-plugin:gerrit-reviews-side-panel'. Please contact your Jira administrators.