Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Cannot assign to non-existent property "..."
Forum Updated to NodeBB v4.3 + New Features

Cannot assign to non-existent property "..."

Scheduled Pinned Locked Moved Solved QML and Qt Quick
11 Posts 5 Posters 2.8k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SPlattenS Offline
    SPlattenS Offline
    SPlatten
    wrote on last edited by SPlatten
    #1

    I am creating a QML file to manage an activity. In another QML file I have declare the QML, not much at the moment, just a placeholder:

    HeadingGauge.qml:

    item {
        id: root
        ...
       staleMgmt {
          id: staleHdg
       }
    }
    

    The location of both files is the same. When I make the project I see:

    HeadingGauge.qml:63:3: Cannot assign to non-existent property `staleMgmt`
    

    What do I need to do?

    The same folder contains both:

    HeadingGauge.qml
    staleMgmt.qml
    

    Kind Regards,
    Sy

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      staleMgmt - Trying making 's' capital. Component name need to be capital - StaleMgmt. Could this issue.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      SPlattenS 1 Reply Last reply
      2
      • dheerendraD dheerendra

        staleMgmt - Trying making 's' capital. Component name need to be capital - StaleMgmt. Could this issue.

        SPlattenS Offline
        SPlattenS Offline
        SPlatten
        wrote on last edited by SPlatten
        #3

        @dheerendra , thank you, now the error is different:

        HeadingGauge.qml:63:3: StaleMgmt is not a type 
               StaleMgmt { 
        
        

        Content of StaleMgmt.qml so far:

        import QtQml 2.1
        import QtQuick 2.3
        import QtQuick.Controls 1.4
        import QtQuick.Controls.Styles 1.4
        import QtQuick.Layouts 1.3
        import QtQuick.Extras 1.4
        
        Item {
            id: root
        
            property var lastValue;
            property var resolution;
            property var showIcon: true;
            property var timeOfLastChange;
        
            Connections {
                function onSetValue(value) {
                }
            }
        
            Image {
                visible: showIcon
                anchors.fill: iconFill
                source: "./Items/stale.svg"
                z: 99
            }
        }
        

        Kind Regards,
        Sy

        1 Reply Last reply
        0
        • JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by
          #4

          @SPlatten said in Cannot assign to non-existent property "...":

          import QtQml 2.1
          import QtQuick 2.3
          import QtQuick.Controls 1.4
          import QtQuick.Controls.Styles 1.4
          import QtQuick.Layouts 1.3
          import QtQuick.Extras 1.4

          Which Qt version is it? Is the qml included in qrc file?

          SPlattenS 1 Reply Last reply
          0
          • JoeCFDJ JoeCFD

            @SPlatten said in Cannot assign to non-existent property "...":

            import QtQml 2.1
            import QtQuick 2.3
            import QtQuick.Controls 1.4
            import QtQuick.Controls.Styles 1.4
            import QtQuick.Layouts 1.3
            import QtQuick.Extras 1.4

            Which Qt version is it? Is the qml included in qrc file?

            SPlattenS Offline
            SPlattenS Offline
            SPlatten
            wrote on last edited by SPlatten
            #5

            @JoeCFD , 5.15.2, yes

            Kind Regards,
            Sy

            JoeCFDJ 1 Reply Last reply
            0
            • SPlattenS SPlatten

              @JoeCFD , 5.15.2, yes

              JoeCFDJ Offline
              JoeCFDJ Offline
              JoeCFD
              wrote on last edited by JoeCFD
              #6

              @SPlatten Try to change the version numbers to 1.15 or 2.15 if possible. Some can not be changed. If not, you will see build errors.

              import QtQml 2.1
              import QtQuick 2.3
              import QtQuick.Controls 1.4
              import QtQuick.Controls.Styles 1.4
              import QtQuick.Layouts 1.3
              import QtQuick.Extras 1.4

              SPlattenS 1 Reply Last reply
              0
              • JoeCFDJ JoeCFD

                @SPlatten Try to change the version numbers to 1.15 or 2.15 if possible. Some can not be changed. If not, you will see build errors.

                import QtQml 2.1
                import QtQuick 2.3
                import QtQuick.Controls 1.4
                import QtQuick.Controls.Styles 1.4
                import QtQuick.Layouts 1.3
                import QtQuick.Extras 1.4

                SPlattenS Offline
                SPlattenS Offline
                SPlatten
                wrote on last edited by
                #7

                @JoeCFD , which numbers?

                Kind Regards,
                Sy

                JoeCFDJ 1 Reply Last reply
                0
                • SPlattenS SPlatten

                  @JoeCFD , which numbers?

                  JoeCFDJ Offline
                  JoeCFDJ Offline
                  JoeCFD
                  wrote on last edited by JoeCFD
                  #8

                  @SPlatten I have
                  import QtQuick 2.15
                  import QtQuick.Controls 2.15
                  import QtQuick.Layouts 1.15

                  In Qt6 these numbers are dropped.

                  SPlattenS 1 Reply Last reply
                  1
                  • JoeCFDJ JoeCFD

                    @SPlatten I have
                    import QtQuick 2.15
                    import QtQuick.Controls 2.15
                    import QtQuick.Layouts 1.15

                    In Qt6 these numbers are dropped.

                    SPlattenS Offline
                    SPlattenS Offline
                    SPlatten
                    wrote on last edited by
                    #9

                    @JoeCFD , thank you, will do that.

                    Kind Regards,
                    Sy

                    1 Reply Last reply
                    0
                    • GrecKoG Offline
                      GrecKoG Offline
                      GrecKo
                      Qt Champions 2018
                      wrote on last edited by
                      #10

                      The import versions have nothing to do with it.

                      Are you using QRC to embed your .qml files? Do both file are included in the QRC? At the same path?

                      1 Reply Last reply
                      0
                      • sierdzioS Offline
                        sierdzioS Offline
                        sierdzio
                        Moderators
                        wrote on last edited by
                        #11
                        This post is deleted!
                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved