[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Setting relative font sizes
From:       Thomas =?iso-8859-1?q?L=FCbking?= <thomas.luebking () web ! de>
Date:       2009-10-24 20:33:09
Message-ID: 200910242233.09465.thomas.luebking () web ! de
[Download RAW message or body]

"large" afaik should work
iirc, richtexts labels are silent QTextBrowsers, thus have support for the 
html subset.

The direct way would of course be:

QFont fnt = widget->font();
if (fnt.pointSize() > -1)
   fnt.setPointSize(fnt.pointSize()+n);
else
   fnt.setPixelSize(fnt.pixelSizeSize()+m);
widget->setFont(fnt);

works for sure ;-)

Thomas

Am Saturday 24 October 2009 schrieb Raphael Kubo da Costa:
> Hi there,
> 
> Currently, I have some QLabels with rich text in them, such as "<font
> size=+1>foo</font>". I'm trying to move this kind of font setting to a
> style sheet in the .ui, or even set it via QLabel::setStyleSheet,
> however setting the style sheet to "font-size: larger;" or anything
> that's not a pixel or point value doesn't work, and I don't know if
> it's possible to set the size in a relative way (like the +1 that's
> being used at the moment).
> 
> Is the current way the only way to give the text a relative size?
> 
> Cheers,
> Raphael
> 
> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
> >> unsubscribe <<
> 

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic