[Interest] specifying units in Qt style sheets

Hamish Moffatt hamish at risingsoftware.com
Mon Jun 24 06:46:16 CEST 2013


On 21/06/13 16:39, Alejandro Exojo wrote:
>
> 2013/6/21 Hamish Moffatt <hamish at risingsoftware.com 
> <mailto:hamish at risingsoftware.com>>
>
>     font-size: 50pt; -- works
>     font-size: 50 pt; -- does not work - results in default font size
>     font-size: 50px; -- works
>     font-size: 50 px; -- does not work - results in default font size
>
>     margin-left: 100pt; -- does not work - results in 0 px
>     margin-left: 100 pt; -- does not work - results in 100 px
>     regardless of
>     pixel density
>     margin-left: 100 px; -- works
>     margin-left: 100px; -- works
>
>
> Doesn't surprise me much (althought it would be better if is more 
> explicitly expressed in the docs, just in case): fonts support points 
> because is frequently used to measure fonts, so QFont supports font 
> sizes in points. But margins and paddings don't support it because 
> QLayout and company don't support it.

But oddly fonts don't support "em" and "ex", which are both directly 
related to fonts, while layouts etc DO support those units. And points 
aren't font related at all - they are a physical size (1/72").

Anyway I raised QTBUG-31907 and I'll have to work around it for now.

Hamish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130624/1fc2f7de/attachment.html>


More information about the Interest mailing list