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

The type compiler incorrectly gives a warning about insufficient annotation for enum types.

    XMLWordPrintable

Details

    • All

    Description

      Description:
      When using a connection to a signal with an enum type parameter, the compiler incorrectly issues warnings about type coercion if the annotation is anything more specific than int. It should correctly recognize either the actual enum type or at least enumeration, but both of these result in warnings.

      Steps to Reproduce:

      1. Open the attached example project.
      1. Observe the four connections to the same signal, each using different annotations.
      1. Build the project and note that the two most specific annotations generate warnings, while the least specific do not.
      1. Click the "Login" button to trigger the signal.

      Expected Behavior:
      The compiler should correctly interpret the enum type without issuing coercion warnings when using enumeration or the actual enum type.

      Actual Behavior:
      Warnings are incorrectly generated for more specific annotations, while broader ones (int) do not trigger warnings.

      Attachments:
      A minimal example project is attached to demonstrate the issue.

      Attachments

        Issue Links

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

          Activity

            People

              qtqmlteam Qt Qml Team User
              chakib Chakib Boutaghane
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes