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

No warning when exposing namepsace with lower case name to QML

    XMLWordPrintable

Details

    Description

      Consider a header like

       

       

      
      #pragma once#include "cppLibrary_global.h"
      #include <QObject>
      #include <QtQml/qqmlregistration.h>
      namespace a::b {
      Q_NAMESPACE_EXPORT(CPPLIBRARY_EXPORT)
      QML_NAMED_ELEMENT(mylib)
      
      enum class MyEnum : quint8
      {
          Val1,
          Val2,
          Val3
      };
      Q_ENUM_NS(MyEnum)
      } // end a::b

      The only thing a header can expose to QML are enums; however, you can't access enums on a lower case name (mylib.MyEnum.Val1 won't work).

      Therefore, this should trigger a build time warning.

       

      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
              fabiankosmale Fabian Kosmale
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes