[Interest] setting arbitrary properties via stylesheet (was Re: set QPushButton pixmap by stylesheet)
André Somers
andre at familiesomers.nl
Fri Mar 15 09:15:23 CET 2013
Op 15-3-2013 2:05, Hamish Moffatt schreef:
> On 14/03/2013 11:52 PM, André Somers wrote:
>> You can set any property using a style sheet, including the minimum
>> size. Perhaps that helps already?
> Any property at all? How about properties of a font associated with a
> QLabel - for example the letter spacing or stretch? I can't seem to
> guess a syntax for the letter spacing, nor follow the stylesheet
> handling code in Qt (4.8.4) well enough to work it out.
>
>
Ok, not quite any property. I meant: any Q_PROPERTY that takes a value
that can be expressed in a way that you can put in a style sheet (AFAIK,
that is basically boils down to anyting that you can put into a QVariant
as a string, and then get out in the format you were after). Most but
not all properties fit that description, as they simply take an integer,
a string, a floating point number or a boolean. These can be expressed
as strings, and thus work fine.
There are no properties in Qt that define letter spacing that I am aware
of. Setting a font is supported directly by Qt's CSS handling.
André
--
You like Qt?
I am looking for collegues to join me at i-Optics!
More information about the Interest
mailing list