Results 1 to 8 of 8

Thread: Stylesheet and QFontMetrics

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Stylesheet and QFontMetrics

    I think the text doesn't depend on the font size, thus you should adjust the font size while drawing the text and not when setting it on the widget. And probably when you do, you'll have the proper font set up on the painter or at least in the style option initialized from the widget. Text size doesn't make sense outside painting routines. The label won't even have the width calculated before it is first shown and I guess you'd want to have a possibility to call this method before the widget is shown.

  2. The following user says thank you to wysota for this useful post:


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
  •  
Qt is a trademark of The Qt Company.