[Qt-qml] Some way to set default font attributes

Fábio Rehm fgrehm at gmail.com
Tue Apr 6 02:15:35 CEST 2010


Thanks for your reply, that's what I ended up doing :-)

I'm also really excited with the initial version of my first QML app, I'll
drop by soon to point u guys the link for it and provide some feedback about
QML itself.


Cheers,
--
Fábio Rehm


On Mon, Apr 5, 2010 at 9:03 PM, <warwick.allison at nokia.com> wrote:

> > Is there a way to set default font attributes for the whole
> > Qml(Context/Engine/View)?
>
> The Text font defaults to the QApplication::font(), which defaults to the
> system font.
>
> > I'm working on a mobile app and I had to set font family and size for
> > every single text component I'm using, I could subclass them but that
> > seems to be too much.
>
> It's perfectly reasonable to "subclass" Text in QML. eg. you might make
> HeaderText.qml that is simply:
>
>  import Qt 4.7
>  Text { font.pixelSize: 20 }
>
> It would be unusual for an application to use just one font and yet for
> that not to be the system default font. An application will more usually
> have a few different types of text and so have a couple of subclasses for
> those that are not the system font.
>
> --
> Warwick
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100405/3b696493/attachment.html 


More information about the Qt-qml mailing list