Results 1 to 2 of 2

Thread: How to set font of QString??

  1. #1
    Join Date
    Oct 2009
    Posts
    105
    Thanked 4 Times in 2 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default How to set font of QString??

    Hi All,
    I've a tool Button of size(100,80). in this button i'm showing an icon, and a string below the icon. String will differ in different language. How to get the string font? so that i can display the text at the centre of toolbutton?

    e.g.
    string may b "Previous" or "Next". I need to allien the string in centre.

  2. #2
    Join Date
    Jan 2009
    Location
    The Netherlands and Spain
    Posts
    150
    Thanks
    6
    Thanked 18 Times in 18 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to set font of QString??

    Qt handles that for you, so you don't have to align the text yourself. Try it with different texts.
    If you need special looks for your button, use a stylesheet.
    Also, if you make correct use of layouts, then the width of the button can be adjusted.

Similar Threads

  1. Replies: 4
    Last Post: 1st February 2010, 14:21
  2. Change Font of QListWidget to Monospace Font
    By pospiech in forum Qt Programming
    Replies: 3
    Last Post: 25th July 2008, 18:23
  3. font incorrectly show - font break.
    By sgh in forum Qt Programming
    Replies: 9
    Last Post: 30th May 2008, 02:35
  4. Replies: 4
    Last Post: 31st January 2008, 20:44
  5. Replies: 1
    Last Post: 25th December 2007, 10:35

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.