[Interest] specifying units in Qt style sheets

Alejandro Exojo aexojo at modpow.es
Fri Jun 21 08:39:48 CEST 2013


2013/6/21 Hamish Moffatt <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.

I would stick to the "NNunit" notation, not "NN unit". I think only the
former is the way to express it in CSS, so Qt's stylesheets follow it. If
it works for margins is because only pixels are supported.


-- 
Alejandro Exojo Piqueras

ModpoW, S.L.
Technova LaSalle | Sant Joan de la Salle 42 | 08022 Barcelona |
www.modpow.es
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130621/c3a6dccc/attachment.html>


More information about the Interest mailing list