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

qmllint doesn't find property that exists

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • 6.10
    • 6.10
    • QML: Tooling
    • None

      Consider the following code

       

      import QtQuick
      import bla
      Item {
          objectName: Plasmoid.pluginName
          Plasmoid.contextualActions: [
              Item {
              }
          ]
      } 

       

      class Applet : public QObject
      {
          Q_OBJECT
          QML_NAMED_ELEMENT(Applet)
          QML_UNCREATABLE("")
          Q_PROPERTY(QQmlListProperty<QObject> contextualActions READ qmlContextualActions NOTIFY contextualActionsChanged)
          Q_PROPERTY(QString pluginName READ pluginName CONSTANT FINAL)
      
      public:
          Applet() { };
          
          QString pluginName() const
          {
              return {};
          }
      
          QML_LIST_PROPERTY_ASSIGN_BEHAVIOR_REPLACE
          QQmlListProperty<QObject> qmlContextualActions()
          {
              return {};
          }
          Q_SIGNAL void contextualActionsChanged();
      };
      
      class PlasmoidAttached : public QObject
      {
          Q_OBJECT
          QML_NAMED_ELEMENT(Plasmoid)
          QML_UNCREATABLE("")
          QML_ATTACHED(Applet)
      
          static Applet *qmlAttachedProperties(QObject *object)
          {
              return new Applet;
          }
      }; 

      Full project at https://invent.kde.org/nicolasfella/proptest
      qmllint warns "Warning: /home/nico/workspace/proptest/Main.qml:9:9: Could not find property "Plasmoid.contextualActions". [missing-property]" but the property exists. The other property, pluginName, is found as expected

       

       

       

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

            qtqmlteam Qt Qml Team User
            nicolasfella Nicolas Fella
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes