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. qt-qml-id ReferenceError after setContextPropertiy
QtWS25 Last Chance

qt-qml-id ReferenceError after setContextPropertiy

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 1 Posters 286 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.
  • M Offline
    M Offline
    make2
    wrote on last edited by
    #1
    MouseArea{
    	anchors.fill: parent
    	onClicked: {
    		fileList.currentIndex = index
    		mainView.openFile(modelData); // call C++ context->setContextPropertiy("", ""), 
    		console.log(fileList) // error: ReferenceError: fileList is not defined
    	}
    }
    

    how can i use id(fileList) after setContextPropertiy?

    M 1 Reply Last reply
    0
    • M Offline
      M Offline
      make2
      wrote on last edited by make2
      #3
      let obj = tabView // save param before call setContextPropertiy
      let tabName = name // save model item attr
      fileList.currentIndex = index
      mainView.openFile(modelData); // call C++ context->setContextPropertiy("", ""), 
      console.log(obj) // res: qml: TabView_QMLTYPE_10(0x3c5a220)
      obj.addTab(tabName)
      

      i do this, it work, but I dont not know why?

      1 Reply Last reply
      0
      • M make2
        MouseArea{
        	anchors.fill: parent
        	onClicked: {
        		fileList.currentIndex = index
        		mainView.openFile(modelData); // call C++ context->setContextPropertiy("", ""), 
        		console.log(fileList) // error: ReferenceError: fileList is not defined
        	}
        }
        

        how can i use id(fileList) after setContextPropertiy?

        M Offline
        M Offline
        make2
        wrote on last edited by
        #2

        @make2 i refresh model of a ListView by setContextProperty

        1 Reply Last reply
        0
        • M Offline
          M Offline
          make2
          wrote on last edited by make2
          #3
          let obj = tabView // save param before call setContextPropertiy
          let tabName = name // save model item attr
          fileList.currentIndex = index
          mainView.openFile(modelData); // call C++ context->setContextPropertiy("", ""), 
          console.log(obj) // res: qml: TabView_QMLTYPE_10(0x3c5a220)
          obj.addTab(tabName)
          

          i do this, it work, but I dont not know why?

          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