qt-interest@trolltech.com
[Top] [All Lists]

Re: Model/Views and fonts.

Subject: Re: Model/Views and fonts.
From: Andreas Pakulat
Date: Sat, 4 Nov 2006 16:07:33 +0100
On 04.11.06 07:43:48, Thomas Fjellstrom wrote:
> On Saturday 04 November 2006 7:34 am, Cavendish Qi wrote:
> > Hi, Thomas,
> >
> > Modify this function in your data model,
> > http://doc.trolltech.com/4.2/qabstractitemmodel.html#data
> >
> > Just get the original data from your abase class, then modified it and
> > return it in your class.
> 
> I already have it implemented so it returns a font object based on 
> QApplication::font(), but id have liked to grab the font from the view that 
> is calling the data() function.

The view doesn't set any font, the itemdelegate uses the font that is
given b the style and then "merges" the font from data() into that via
resolve. So using QApplication::font() and setting only weight and
italic should produce exactly what your after (or just contruct a new
default font by using QFont f; f.setWeight()...)

Andreas

-- 
Is this really happening?

--
To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/

<Prev in Thread] Current Thread [Next in Thread>