Results 1 to 4 of 4

Thread: QPainter::drawText, draw big text

  1. #1
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    691
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QPainter::drawText, draw big text

    Hi I would draw text over my QWidget.
    So I though to use
    Qt Code:
    1. QPainter::drawText( QPoint(x,y), "hh:mm:ss" );
    To copy to clipboard, switch view to plain text mode 

    The problem is that I would draw big text and such routine doesn't provide such functionality.
    I also would choose the color of the text.

    How can I do?

    Best Regards
    Franco Amato

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPainter::drawText, draw big text

    How about using QPainter::setFont before the drawText

  3. #3
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QPainter::drawText, draw big text

    can also use transformation functions like QPainter::scale().

  4. #4
    Join Date
    Mar 2008
    Location
    France
    Posts
    149
    Thanks
    2
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QPainter::drawText, draw big text

    In your paintEvent(QPaintEvent* event) fct, you could use:
    Qt Code:
    1. QFont font=painter.font() ;
    2. font.setPointSize ( 18 );
    3. //font.setWeight(QFont::DemiBold);
    4. painter.setFont(font);
    5. painter.drawText(....);
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 2
    Last Post: 20th September 2009, 02:59
  2. QPainter drawText with different language
    By lni in forum Qt Programming
    Replies: 4
    Last Post: 11th June 2009, 19:54
  3. QPainter::drawText
    By h123 in forum Qt Programming
    Replies: 8
    Last Post: 15th November 2008, 10:10
  4. Qt drawText QPainter
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 7th April 2008, 19:00
  5. HTML text drawn with QPainter::drawText()
    By MarkoSan in forum Qt Programming
    Replies: 1
    Last Post: 19th January 2008, 01:23

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.