Results 1 to 2 of 2

Thread: QStyleSheet font-size as percentage?

  1. #1
    Join Date
    Jun 2010
    Posts
    8
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QStyleSheet font-size as percentage?

    I'd like to set a font-size value in a QStyleSheet, e.g.:

    QLineEdit { font-size: 80%; }

    But this does not seem to work at all. I can set the size absolutely using "pt", "px", etc. Should I expect using percentages to work?

    (My actual goal is sizing a QComboBox in a QTreeView where most of the other item widgets are just text. I want to make the QComboBox smaller so it doesn't stand out so much and increase the row height. But I wanted to do this in a platform-independent way.)

    Thanks,
    Dan

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: QStyleSheet font-size as percentage?

    Quoting the documentation:

    The font size. In this version of Qt, only pt and px metrics are supported.

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

    dhalbert (26th June 2010)

Similar Threads

  1. Font size in QGraphicsTextItem
    By rippa in forum Qt Programming
    Replies: 1
    Last Post: 7th December 2008, 19:11
  2. adjust font size to QLabel-size
    By hunsrus in forum Qt Programming
    Replies: 0
    Last Post: 9th July 2008, 14:33
  3. Font Size
    By MrShahi in forum Qt Programming
    Replies: 3
    Last Post: 9th July 2008, 07:37
  4. QTreeView font size not being set
    By forrestfsu in forum Qt Tools
    Replies: 2
    Last Post: 12th October 2006, 13:53
  5. change font size and button size of QMessageBox
    By nass in forum Qt Programming
    Replies: 6
    Last Post: 13th September 2006, 19:16

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.