PDA

View Full Version : width in QSimpleRichText



Pan Wojtas
28th January 2006, 21:19
Hi!
I have an image 640x480 (for example) and one code:
QSimpleRichText *aaa = new QSimpleRichText("<img src=\"/path/to/my/image_640x480.jpg\">", font(), QString::null, 0);
and the second one:
QSimpleRichText *bbb = new QSimpleRichText("<img src=\"/path/to/my/image_640x480.jpg\">", font(), QString::null, 0, QMimeSourceFactory::defaultFactory());
...and results (varible: value):
aaa->widthUsed(): 648
aaa->width(): 644
aaa->height(): 486
bbb->widthUsed(): 656
bbb->width(): 652
bbb->height(): 486

Who could tell me:
1. Why none of these values is equal to image's sizes?
2. Why values of "aaa" are different then "bbb's"?
3. What can i do to give QSimpleRichText proper values (i mean equal to image's sizes)?

wysota
28th January 2006, 22:29
My guess is that the dimensions returned include image spacing. Maybe you should just render your picture directly without using rich text?