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

qmllint: warn about private INVOKABLEs

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P2: Important
    • 6.x
    • 6.4.1
    • QML: Tooling

    Description

      Add a warning in qmllint when trying to call a private Q_INVOKABLEs from qml.

       

      // type.h
      class Type : public QObject
      {
          Q_OBJECT
          QML_ELEMENT
      
          Q_INVOKABLE void f(); // private and therefore not callable from qml
      public:
          Q_INVOKABLE void f2(); // is correct
      };
      
      // main.qml
      import QtQuick
      
      Type {
          Component.onCompleted: { f() } // warn that f is private
      }
      

      Attachments

        Activity

          People

            qtqmlteam Qt Qml Team User
            sami.shalayel Sami Shalayel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: