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 change text of Text1
Forum Updated to NodeBB v4.3 + New Features

Cannot change text of Text1

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 386 Views 1 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.
  • D Offline
    D Offline
    DTRQ
    wrote on 24 Feb 2018, 10:55 last edited by
    #1

    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)

    1 Reply Last reply
    0
    • O Offline
      O Offline
      ODБOï
      wrote on 25 Feb 2018, 12:40 last edited by
      #2

      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
      }
      
      1 Reply Last reply
      0

      1/2

      24 Feb 2018, 10:55

      • Login

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