PDA

View Full Version : How to append the text from the buttons into Textfield in qt qml?



harish
24th January 2012, 07:07
Hi all,
I am trying to display the text inside a button in a Textfield using Qt Qml.

I am having a button with a text "Apple" and a Textfield which is blank.

I had tried and displayed the text in the textfield using this code:


Button {
id: button13
x: 76
y: 447
text: "Apple"
onClicked: {

t.visible = text
}


TextField {
id: t
x:76
y:129
width: 230
height: 50
text: ""

}
Now what i am trying for is:

I am having two buttons with different text inside it.

For example:in 1st button "Apple" and in 2nd button "Banana" i need to display the text inside the two buttons in the text field.....

Which means i need to display AppleBanana in the textfield...


I mean:How to append those two values into the text field?

Anyone come with the answer????

Thanks in advance,
Harish