PDA

View Full Version : QFont



ghorwin
23rd January 2007, 22:34
Hi there,

In a widget that does some fancy drawing including text, I would like to update my rendering when the user of the widget changes the font via setFont(). This is also important for the widget when used in Designer, because the user would want to see changes to the font face/size/style immediately in the widget.

How would I do that best? The only solution (I could think of) would be to store the font last used to draw the widget components and compare it during each update with the current font... not the best way, I assume. Any ideas?

Bye,
Andreas

jpn
23rd January 2007, 22:44
Override QWidget::changeEvent() and catch QEvent::FontChange.