Results 1 to 2 of 2

Thread: How to improve the font style?

  1. #1
    Join Date
    Mar 2009
    Posts
    20
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to improve the font style?

    Hi all,
    Good morning!
    I meet a question about font style. When I use QPainter::drawText(...) method to draw a text on QGraphicsScene, but the text is not
    clearly,like attachment. And how to fix it? Thanks!
    By the way, The font's family is "Times", my code is like below:
    QFont font = QFont("Times");
    font.setPixelSize(4);
    font.setFixedPitch(true);
    QPen pe = painter.pen();
    pe.setFont(font);
    painter.setPen(pe);
    painter.drawText(pos, index);
    Attached Images Attached Images

  2. #2
    Join Date
    Jul 2009
    Posts
    139
    Thanks
    13
    Thanked 59 Times in 52 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to improve the font style?

    It looks like you are drawing the text multiple times at a slightly different postion. Use qDebug to see what pos is doing. Or paste some more code, preferably the minimum amount to reproduce the problem.

Similar Threads

  1. Improve performance QPainter
    By Programm3r in forum Qt Programming
    Replies: 2
    Last Post: 12th November 2009, 07:23
  2. QDial looks too ugly, Why not improve it
    By lmax in forum Qt Tools
    Replies: 2
    Last Post: 13th March 2009, 21:03
  3. Replies: 6
    Last Post: 5th March 2009, 06:26
  4. How to improve fonts in designer ?
    By probine in forum Qt Tools
    Replies: 3
    Last Post: 25th October 2006, 20:38
  5. Font Style
    By atil in forum Qt Programming
    Replies: 1
    Last Post: 20th September 2006, 08:29

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.