Results 1 to 4 of 4

Thread: QText, how to only change font family?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QText, how to only change font family?

    This is strange but maybe the new font doesn't have that particular size.

    If the pointSize is the only thing that changes with the family you could "remember" it as well

    Qt Code:
    1. currentfont = ui_vp_message->font();
    2. const int pointSize = currentFont.pointSize();
    3. currentFont.setFamily(...);
    4. currentFont.setPointSize(pointSize);
    To copy to clipboard, switch view to plain text mode 

    Cheers,
    _

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

    UriTK (9th April 2019)

Similar Threads

  1. Replies: 3
    Last Post: 11th October 2011, 17:58
  2. Requested font family failed
    By wirasto in forum Qt Programming
    Replies: 0
    Last Post: 20th November 2010, 04:30
  3. Font family for non-latin text.
    By chandan in forum Newbie
    Replies: 0
    Last Post: 25th May 2010, 13:01
  4. QTextEdit and font family
    By giusepped in forum Qt Programming
    Replies: 6
    Last Post: 4th June 2008, 10:17
  5. Replies: 1
    Last Post: 25th December 2007, 10:35

Tags for this Thread

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.