How can we know the width and height of string ?
General and Desktop
3
Posts
3
Posters
2.0k
Views
1
Watching
-
If you use layout than you can just properly specify size constraints. Otherwise you can use "QFontMetrics":http://developer.qt.nokia.com/doc/qt-4.7/qfontmetrics.html
-
In QML you can also use the paintedHeight and width properties. Take care of a detail (not sure it is a bug):
When you use a word-wrapped string you should forcerly add a '\n' character ad the end of the string else the painted properties alway returns the corresponding sized minus the last wrapped line.