PDA

View Full Version : Distance between axis title and widget border



FelixB
16th June 2011, 12:54
Hi,

I use rich text in my labels. when I have <sup> in the title of left axis, the <sup>-text is not visible completely - it is drawn "outside the borders". the same behaviour is at bottom title and <sub>.

How can I increase the distance between axis title and widget border? I already tried setMinimumExtent() for the PlotScaleDraws but that did not change anything, the title is still printed at the border.

any ideas?
Felix

Uwe
17th June 2011, 17:41
plot->axisWidget(...)->setContentsMargins( ... );Uwe

FelixB
20th June 2011, 09:31
hm... I tried the following, but that did not change anything:



plot->setAxisTitle(id, text);
plot->axisWidget(id)->setContentsMargins(100, 100, 100, 100);

I tried your suggestion in the bode example without success too.

Uwe
20th June 2011, 20:09
Indeed, setting contents margins doesn't work.

But setting a margin to work around layout problems is not the right solution. Instead I would like to find out why the text is truncated.

What environment are you using, what fonts and what is your axis title in detail ?

Uwe

FelixB
21st June 2011, 09:39
I'm sorry, I should have tested a bit more. The problem seems to affect only the font "MS Sans Serif" (in all tested sizes). All other (now tested) fonts seem to be printed correctly.

I use Win7 64bit. axis was yLeft (xBottom worked fine - with <sub> instead of <sup> of course), title = "<html> Kinetic Energy [10<sup>3</sup>eV]</html>"

thanks for your help!

Uwe
26th June 2011, 11:43
Well - the Qwt layout code relies on the geometries returned by Qt. If there is something wrong for a special font only I'm afraid there is not much I can do on my side.

Anyway - to find out more about this problem please check the code in QwtRichTextEngine::heightForWidth and QwtRichTextEngine::textSize and see what goes wrong with this font on your system.

Uwe