[Qt-interest] Stylesheets and dynamic font sizes - what's the best way?

David Greaves david at dgreaves.com
Wed Mar 4 14:42:57 CET 2009


My application runs on the N800, a low-powered PDA.
I have a list of widgets containing Qlabels and I want to implement a zoom
facility which changes the point-size of the text.

What is the best/right way to do this?

Do I iterate over all the children to find QLabels and setFont() on them? (or
similar using signals). IIRC this has issues co-existing with CSS.

Do I call something like:
qApp->setStyleSheet("Shopper--ItemView QLabel  { font-size:
"+QString::number(12+fontsize*2)+"pt; } ");

Using a global stylesheet seems to really slow down the application startup on
this tiny device.

David


-- 
"Don't worry, you'll be fine; I saw it work in a cartoon once..."



More information about the Qt-interest-old mailing list