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

No warning when exposing namepsace with lower case name to QML

XMLWordPrintable

      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.

       

        For Gerrit Dashboard: QTBUG-138244
        # Subject Branch Project Status CR V

            qtqmlteam Qt Qml Team User
            fabiankosmale Fabian Kosmale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change