Results 1 to 2 of 2

Thread: QFont

  1. #1
    Join Date
    Nov 2006
    Location
    Dresden, Germany
    Posts
    108
    Thanks
    9
    Thanked 12 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question QFont

    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

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QFont

    Override QWidget::changeEvent() and catch QEvent::FontChange.
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    ghorwin (23rd January 2007)

Similar Threads

  1. Default value for QFont
    By Kapil in forum Qt Programming
    Replies: 1
    Last Post: 2nd June 2006, 06:40
  2. why we have need of QApplication
    By Krishnacins in forum Qt Programming
    Replies: 11
    Last Post: 12th April 2006, 16:37

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.