Results 1 to 6 of 6

Thread: QFont::setPointSize() does not take effect

  1. #1

    Default QFont::setPointSize() does not take effect

    In the constructor of the main dialog (inherited from QDialog), I create a QPushButton, the I change its font size using QFont::setPointSize(). But when shown, the font size of QPushButton remains default. It seems that QFont::setPointSize does not take effect or the font size of QPushButton is overrided by something ?
    So what' s the chance to change the font size of QPushButton ? How ?
    My app is running on Windows Mobile 5, thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFont::setPointSize() does not take effect

    How do you exactly use setPointSize()?

  3. #3

    Default Re: QFont::setPointSize() does not take effect

    Qt Code:
    1. QFont font = pushButton->font();
    2. font.setPointSize(9); // specificy the font size
    3. pushButton->setFont(font);
    To copy to clipboard, switch view to plain text mode 
    Last edited by jpn; 27th July 2008 at 10:29. Reason: missing [code] tags

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFont::setPointSize() does not take effect

    Do you use a scalable font?

  5. #5

    Default Re: QFont::setPointSize() does not take effect

    what's scalable font ?
    I just create a QDialog inherited object and show it in main.

    thanks!

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFont::setPointSize() does not take effect

    Quote Originally Posted by lovelypp View Post
    what's scalable font ?
    It's a font that you can scale as opposed to a fixed-size font which comes only in certain sizes.

    What is the default font on your system?

Similar Threads

  1. QImage glow effect
    By MarkoSan in forum Qt Programming
    Replies: 4
    Last Post: 31st March 2008, 06:15
  2. Designing a "slide-out" effect
    By Gray in forum Qt Programming
    Replies: 1
    Last Post: 26th September 2007, 10:52
  3. drawing shadow effect
    By vijay anandh in forum Qt Programming
    Replies: 1
    Last Post: 25th May 2006, 15:41
  4. QT3: mouseover effect in QListViewItem
    By karye in forum Qt Programming
    Replies: 3
    Last Post: 1st April 2006, 12:44
  5. Replies: 9
    Last Post: 5th March 2006, 03:31

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.