Results 1 to 4 of 4

Thread: Set specific font's face

  1. #1
    Join Date
    Oct 2010
    Posts
    15
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Set specific font's face

    Hi there!

    Can you help me setting the specific font face?
    For example, I would like to use Helvetica Neue Light font.
    I've tried following method, but had no luck:
    Qt Code:
    1. setStyleSheet("font-family: 'HelveticaNeue-Light', 'Helvetica Neue Light';");
    To copy to clipboard, switch view to plain text mode 

    As well the following doesn't help neither:
    Qt Code:
    1. setStyleSheet("font-family: 'Helvetica Neue';"
    2. "font-width: 100;");
    To copy to clipboard, switch view to plain text mode 

    By the way, how can I set style for all widgets by one setStyleSheet? Is it correct to doing it by:
    Qt Code:
    1. setStyleSheet("QWidget {bla-bla-bla}");
    To copy to clipboard, switch view to plain text mode 
    Last edited by Cucumber; 19th November 2010 at 12:48.

  2. #2
    Join Date
    Nov 2010
    Posts
    57
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Set specific font's face

    Something like:
    setStyleSheet("*{font: bold 10pt \"Arial\";}") should work on all objects.

    I guess you'll have to have the font installed on you machine? and you'll need to call it from the top window (use the window() method)?

  3. #3
    Join Date
    Oct 2010
    Posts
    15
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Set specific font's face

    Thank you for "*" and "window()" methods!
    And as for first question, how to set specific face of the font?

  4. #4
    Join Date
    Jan 2008
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default Re: Set specific font's face

    Cucumber > maybe it would work if you use the code of your first post after added the font to the database http://doc.qt.nokia.com/latest/qfont...pplicationFont

Similar Threads

  1. Font Height and width based on font size
    By Ghufran in forum Qt Programming
    Replies: 1
    Last Post: 31st July 2010, 08:02
  2. How to design a state machine in face of non-blocking I/O?
    By piotr.dobrogost in forum Qt Programming
    Replies: 26
    Last Post: 14th August 2009, 19:48
  3. Problem with specific font
    By ratsrcute in forum Qt Programming
    Replies: 1
    Last Post: 21st February 2009, 14:57
  4. Change Font of QListWidget to Monospace Font
    By pospiech in forum Qt Programming
    Replies: 3
    Last Post: 25th July 2008, 18:23
  5. font incorrectly show - font break.
    By sgh in forum Qt Programming
    Replies: 9
    Last Post: 30th May 2008, 02: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.