Cannot change text of Text1



  • Hi
    I'm trying to make an Android application. Everything is fine, but I can't change text of Text1. I've created function "function setText(value1)" and I've put "txt1 = value1" in this function. I've added "property alias txt1: text1.text", too. This function is begin called from C++, but I think it is not a problem, because if i put "console.log(value1)" in the function, value1 is showing up normally in the console. Here's some code from pastebin.
    Thanks, DTRQ

    (sorry for my english)



  • hi @DTRQ
    this must work:

    property string tx
    onTxChanged : {
       text1.text = tx
    }
    Text {
    id: text1
    }
    function setText(value1) {
     tx=value1
    }
    

    or maybe try without alias :

    Text {
    id: text1
    }
    function setText(value1) {
     text1.text=value1
    }
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.