mercredi 17 avril 2019

how to have make a QString have a specific size in QT?

My problem is that in i will have a QString valthat will get different values there. But i want all of results to have a fixed number of charaters, for example 20.

So if the word i put there is less than that number of charaters it will put white spaces to the right.

An example, lets suppose i have 2 words: "abc" and "abcdefghijklmno"

for the first case:

qDebug()<<val; //"abc "

for the second case:

qDebug()<<val; //"abcdefghijklmno "

how can it be done?

Aucun commentaire:

Enregistrer un commentaire