Q
Q
qvlad2012-10-11 20:26:24
Qt
qvlad, 2012-10-11 20:26:24

How to autocomplete a given character in QML Text?

For example, when passing the value value = 5, 05 was displayed

Text {
  id: separate1
  y: 15
  color: "white"
  text: value
  font.pixelSize: 20
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Sidorov, 2012-10-12
@Gortauer87

There was also a topic regarding input mask, it works the same as in the rest of Qt

L
lolopolosko, 2012-10-11
@lolopolosko

You can substitute in text for example

Text {
    id: separate1
    y: 15
    color: "white"
    text: autoValue + value
    font.pixelSize: 20
}

Or, for convenience, create a function that will return the required value
function generate(var value){
/*####*/
return genValue;}

Text {
    id: separate1
    y: 15
    color: "white"
    text: generate(variable)
    font.pixelSize: 20
}

Or create your own Item

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question