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

qmllint: Type "QList<int>" of property "boo" not found

    XMLWordPrintable

Details

    • 8e69558f2f (qt/qtdeclarative/dev) 2b8b69edc1 (qt/qtdeclarative/6.4) 2b8b69edc1 (qt/tqtc-qtdeclarative/6.4)

    Description

      When I ran qmllint against cod bellow, I got such warning:

      main.qml:14:24: Type "uint" of property "foo" not found. This is likely due to a missing dependency entry or a type no 
      t being exposed declaratively.                                                                                                                                                    
              win.a = myItem.foo + 1;                                                                                                                                                   
                             ^^^         
      

      main.qml:

      import QtQuick 2.15                                                                                                                                                               
      import QtQuick.Window 2.15                                                                                                                                                        
      import example.mylib                                                                                                                                                              
                                                                                                                                                                                        
      Window {                                                                                                                                                                          
          id: win                                                                                                                                                                       
          width: 640                                                                                                                                                                    
          height: 480                                                                                                                                                                   
          visible: true                                                                                                                                                                 
          title: qsTr("Hello World")                                                                                                                                                    
          property int a: 16                                                                                                                                                            
                                                                                                                                                                                        
          Component.onCompleted: {                                                                                                                                                      
              win.a = myItem.foo + 1;                                                                                                                                                   
              console.log("win.a =", win.a);                                                                                                                                            
          }                                                                                                                                                                             
          MyItem {                                                                                                                                                                      
              id: myItem                                                                                                                                                                
          }                                                                                                                                                                                                                                                                                                 
      }                                                                                                                                                                                 
      

      Where MyItem type defined in C++ in such way:

      #include <QQuickItem>                                                                                                                                                             
                                                                                                                                                                                        
      class MyItem : public QQuickItem                                                                                                                                                  
      {                                                                                                                                                                                 
          Q_OBJECT                                                                                                                                                                      
          QML_ELEMENT                                                                                                                                                                   
          Q_PROPERTY(quint32 foo MEMBER foo_ NOTIFY fooChanged FINAL)                                                                                                                   
      signals:                                                                                                                                                                          
              void fooChanged();                                                                                                                                                        
      public:                                                                                                                                                                           
              MyItem();                                                                                                                                                                 
      private:                                                                                                                                                                          
              quint32 foo_ = 17;                                                                                                                                                        
      };       
      

      If I change "foo" type to "int" qmllint becomes happy,
      but with quint32 qml runtime works without any problem.

      May be builtins.qmltypes should have component for "uint" ?

      Also I got warnings "type not found" for such types "qulonglong", "QVector<int>", "vector<qreal>", "QList<int>".

      I use qtdeclarative (d52a2098b91d037ddcd5d9a75106e78689d8aba5).
      For generation of qmltypes I use cmake::qt_add_qml_module.

      Attachments

        Issue Links

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

          Activity

            People

              ulherman Ulf Hermann
              evgeniy_dushistov evgeniy_dushistov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes