View Full Version : Design help please

12th October 2006, 14:29

I have an application which has lots of input boxes whose font size and font family can be changed by the user in the preferences window.

I have a class called Preferences where I store this information by reading it from the ini file using QSettings.

The path to the input boxes is

MainWindow->Splitter->ScrollArea->Widget->Input Box

How can I pass the font information from preferences to the input boxes?

Currently, I have a singleton class called Preferences and I call Preferences::Instance() whereever I need in my program.

I doubt if this is a nice way.

Can someone tell me if there is a better way ?

Thanks a lot

12th October 2006, 22:50
Just returned from DevDays (was GREAT!!:cool: - I'll post inpressions later) and they showed how to use tyle sheets.
With just few lines of code, you can influence the whole look and feel of our widget, on various scopes (specific object, class, hirarchy etc...) .
This is very powerfull, but not yet fully mature.
Not all widgets are supported, and there are still some things to improrve, but man, it really rocks!
Its exactly what you want to do here, but all done for you by Qt - you only need to supply the values for the various style properties.
Another way is to implement a proxy style.