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. Id and properties not found problem

Id and properties not found problem

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
propertycomponent
5 Posts 3 Posters 2.1k Views
  • 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.
  • O Offline
    O Offline
    olivierguzziIDEOL
    wrote on last edited by
    #1

    Dear all,

    I'm actually experimenting Qt/QML with RTMaps (a real time graphical programming tool).

    I faced with an issue a lot of time, i could turn around but i'm really asking why when I use this component (the code is just below) in my main .qml,
    the property defined using the ParamsPanel's id azert raises an error: azert id cannot be found but it is.
    I had the issue with the Rectangle called container.

    import QtQuick 2.5
    import QtQuick.Controls 1.0 /** Tab import **/
    
    /** #### SettingsTab component ### **/
    Tab {
        id : root
        title : "Settings"
        anchors.fill: parent
    
        /** ### Properties ### **/
        /** ### INPUTS ### **/
        property string ipIn: ""
        property int portIn: 0
        property int interPingIn: 0
        property int packetCountIn: 0
        /** ### OUTPUTS ### **/
        property string ipOut: azert.ipOut
        property int portOut: azert.portOut
        property int interPingOut: azert.interPingOut
        property int packetCountOut: azert.packetCountOut
    
        /** #### SubComponents ### **/
        Rectangle {
            id : container
            anchors.fill: parent
            color: "#00000000"
    
            /** #### SubComponents [LEVEL 2] ### **/
            ParamsPanel {
    
                x: 282
                y: 243
                id:azert     
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 127
                anchors.right: parent.right
                anchors.rightMargin: 30
    
                /** ### INPUT PROPERTIES SET ### */
                ipIn: root.ipIn
                portIn: root.portIn
                interPingIn: root.interPingIn
                packetCountIn: root.packetCountIn
            }
        }
    }
    
    

    The error:

    SettingsTab.qml:40: ReferenceError: azert is not defined
    SettingsTab.qml:39: ReferenceError: azert is not defined
    SettingsTab.qml:38: ReferenceError: azert is not defined
    SettingsTab.qml:37: ReferenceError: azert is not defined
    

    If someone see where i am wrong, please help me ! :)

    Thanks for your help,
    Olivier

    ekkescornerE 1 Reply Last reply
    0
    • O olivierguzziIDEOL

      Dear all,

      I'm actually experimenting Qt/QML with RTMaps (a real time graphical programming tool).

      I faced with an issue a lot of time, i could turn around but i'm really asking why when I use this component (the code is just below) in my main .qml,
      the property defined using the ParamsPanel's id azert raises an error: azert id cannot be found but it is.
      I had the issue with the Rectangle called container.

      import QtQuick 2.5
      import QtQuick.Controls 1.0 /** Tab import **/
      
      /** #### SettingsTab component ### **/
      Tab {
          id : root
          title : "Settings"
          anchors.fill: parent
      
          /** ### Properties ### **/
          /** ### INPUTS ### **/
          property string ipIn: ""
          property int portIn: 0
          property int interPingIn: 0
          property int packetCountIn: 0
          /** ### OUTPUTS ### **/
          property string ipOut: azert.ipOut
          property int portOut: azert.portOut
          property int interPingOut: azert.interPingOut
          property int packetCountOut: azert.packetCountOut
      
          /** #### SubComponents ### **/
          Rectangle {
              id : container
              anchors.fill: parent
              color: "#00000000"
      
              /** #### SubComponents [LEVEL 2] ### **/
              ParamsPanel {
      
                  x: 282
                  y: 243
                  id:azert     
                  anchors.bottom: parent.bottom
                  anchors.bottomMargin: 127
                  anchors.right: parent.right
                  anchors.rightMargin: 30
      
                  /** ### INPUT PROPERTIES SET ### */
                  ipIn: root.ipIn
                  portIn: root.portIn
                  interPingIn: root.interPingIn
                  packetCountIn: root.packetCountIn
              }
          }
      }
      
      

      The error:

      SettingsTab.qml:40: ReferenceError: azert is not defined
      SettingsTab.qml:39: ReferenceError: azert is not defined
      SettingsTab.qml:38: ReferenceError: azert is not defined
      SettingsTab.qml:37: ReferenceError: azert is not defined
      

      If someone see where i am wrong, please help me ! :)

      Thanks for your help,
      Olivier

      ekkescornerE Offline
      ekkescornerE Offline
      ekkescorner
      Qt Champions 2016
      wrote on last edited by
      #2

      @olivierguzziIDEOL said in Id and properties not found problem:

      property string ipOut: azert.ipOut

      probably azert isn't created at the time the ipOut string refers to azert
      try something like this:

      property string ipOut: azert? azert.ipOut : ""
      

      ekke ... Qt Champion 2016 | 2024 ... mobile business apps
      5.15 --> 6.8 https://t1p.de/ekkeChecklist
      QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

      1 Reply Last reply
      0
      • O Offline
        O Offline
        olivierguzziIDEOL
        wrote on last edited by
        #3

        I tried but it didn't work :/
        I already tried to put the property declaration under the azert (ParamsPanel) declaration but it didn't work too.

        The id is declared just after its use.

        It seems like my component's id isn't set to what i wrote after id:, is it possible ? When i launch my console, the display is nice but i can't access ipOut from my program.
        I have a big problem with id.

        ekkescornerE E 2 Replies Last reply
        0
        • O olivierguzziIDEOL

          I tried but it didn't work :/
          I already tried to put the property declaration under the azert (ParamsPanel) declaration but it didn't work too.

          The id is declared just after its use.

          It seems like my component's id isn't set to what i wrote after id:, is it possible ? When i launch my console, the display is nice but i can't access ipOut from my program.
          I have a big problem with id.

          ekkescornerE Offline
          ekkescornerE Offline
          ekkescorner
          Qt Champions 2016
          wrote on last edited by
          #4

          @olivierguzziIDEOL sorry - have no idea. never did QtQuickControls 1.0 apps - started Qt development with QtQuickControls2

          ekke ... Qt Champion 2016 | 2024 ... mobile business apps
          5.15 --> 6.8 https://t1p.de/ekkeChecklist
          QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

          1 Reply Last reply
          0
          • O olivierguzziIDEOL

            I tried but it didn't work :/
            I already tried to put the property declaration under the azert (ParamsPanel) declaration but it didn't work too.

            The id is declared just after its use.

            It seems like my component's id isn't set to what i wrote after id:, is it possible ? When i launch my console, the display is nice but i can't access ipOut from my program.
            I have a big problem with id.

            E Offline
            E Offline
            Eeli K
            wrote on last edited by Eeli K
            #5

            @olivierguzziIDEOL You can define Component.onCompleted for each item where you check if azert is available.

            Component.onCompleted: {
            console.log("Tab(/Rectangle/ParamsPanel) is now completed")
            console.log(azert)
            }
            

            It should be at least in ParamPanel's onCompleted. There you should be able to bind the Tab's properties dynamically.

            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