[Kde-games-devel] KBreakout's QML port

Viranch Mehta viranch.mehta at gmail.com
Sat Jan 5 08:51:00 UTC 2013


On 05-Jan-2013, at 1:43 PM, Wolfgang Rohdewald wrote:

> Am Samstag, 5. Januar 2013, 11:17:21 schrieb Viranch Mehta:
>> This is because it has to calculate the maximum size of the score text which can be fit in the box. 
> 
>            fm = QFontMetrics(self.painter.font())
>            strLen = fm.width('the score text')

I should get the painter object by myDeclarativeView->paintEngine()->painter() , i suppose.

also, often i'm more interested in the height of the text (its always the height of the text that limits the font size to fit the text in the box) - which I can get from fm.height() I guess.

will give this a shot.

Cheers,
Viranch


More information about the kde-games-devel mailing list