Results 1 to 4 of 4

Thread: multiline text on QPainter

  1. #1
    Join Date
    Jun 2011
    Posts
    22
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default multiline text on QPainter

    Hi...

    i want to display multiline text on QPainter.
    My problem is when i display the content of QTextEdit(multiline text),it display in the same line.

    so please tell me that how can i display multiline text on QPainter..

    waiting for quick reply..

    Thanks..

  2. #2
    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: multiline text on QPainter

    use
    Qt Code:
    1. void QPainter::drawText ( const QRectF & rectangle, int flags, const QString & text, QRectF * boundingRect = 0 )
    To copy to clipboard, switch view to plain text mode 
    to draw multiline text

  3. #3
    Join Date
    Jun 2011
    Posts
    22
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: multiline text on QPainter

    Thanks for reply..

    But i want to use QTextEdit because i want to get all co-ordinates of that text through QPainterPath...

    So please tell me that how can i use QTextEdit with multiline..

  4. #4
    Join Date
    Dec 2010
    Location
    Russia
    Posts
    83
    Thanks
    1
    Thanked 12 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: multiline text on QPainter

    Probably I've not quite understood why you could not use what nish had suggested. I mean ,you can always get current position with the QPainterPath::currentPosition() in the active path,can't you? Just use this point in one of the overloaded QPainter::drawText methods with the Flag set to Qt::TextWordWrap...Some code would be nice, if you still experiencing the problem

Similar Threads

  1. Animated text with QPainter
    By onurozcelik in forum Qt Programming
    Replies: 1
    Last Post: 1st June 2010, 10:04
  2. Align text's in Qpainter
    By sanku in forum Qt Programming
    Replies: 8
    Last Post: 23rd April 2010, 09:29
  3. Multiline in QAction text
    By skimpax in forum Qt Programming
    Replies: 5
    Last Post: 15th October 2009, 17:58
  4. Text rotation in QPainter
    By acpRobert in forum Newbie
    Replies: 1
    Last Post: 29th April 2009, 21:07
  5. Lists/multiline text in QTableView cells
    By dv_ in forum Qt Programming
    Replies: 1
    Last Post: 22nd June 2008, 23:43

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.