[Qt-interest] Problems with StyleSheet and QFontMetrics (see attached program)

hi hiralsmaillist at gmail.com
Fri Jan 15 13:55:11 CET 2010


Hi,

Herewith I have attached a toy program in which it sets the stylesheet "* {
font-size: 20pt; }" of app context.

After setting above style sheet, I am taking QFontMetrics to do some
processing on fontmetrics.width() / fontmetrics.height() but both are
getting wrong.

In toy program if you click "Print Font Info" button, I displays the correct
information.
But when showing the fontmetrics of dialog (click on 'Show Dialog') or panel
(click on 'Show Panel') it displays wrong.

In short: my aim is to set application font and subsequently I should get
the correct fontmetrics info.

Please let me know if I am doing anthing wrong.

Thank you.
-Hiral
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100115/b517abad/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_fontmetrics.tar.gz
Type: application/x-gzip
Size: 2313 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100115/b517abad/attachment.gz 


More information about the Qt-interest-old mailing list