[Qt-interest] QStaticText class and multiline text
Atlant Schmidt
aschmidt at dekaresearch.com
Mon Aug 30 14:22:31 CEST 2010
Constantin:
HTML formatting should work, no?
So use <br/> tags in place of your \n characters.
http://doc.trolltech.com/4.7-snapshot/qstatictext.html
For extra convenience, it is possible to apply formatting
to the text using the HTML subset supported by QTextDocument
QStaticText will attempt to guess the format of the input
text using Qt::mightBeRichText(), and interpret it as rich
text if this function returns true. To force QStaticText to
display its contents as either plain text or rich text, use
the function QStaticText::setTextFormat() and pass in,
respectively, Qt::PlainText and Qt::RichText.
Atlant
-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Constantin Makshin
Sent: Sunday, August 29, 2010 6:17 AM
To: Qt Interest
Subject: [Qt-interest] QStaticText class and multiline text
Hi!
I have an application that works with data shown to the user in the form of flowcharts. Since these flowcharts contain relatively high amount of text and that text doesn't change too often, I thought using QStaticText could improve application's performance (currently text is drawn by QPainter::drawText() and I haven't had any performance-related problems so far). But when I tried to use it, I discovered that QStaticText doesn't [seem to] support text with explicit linebreaks and draws empty squares in place of '\n' characters.
Is this a bug or intended behavior? Are there any plans to add support of multiline text to QStaticText and QPainter::drawStaticText()?
I use Qt 4.7.0 RC1 at the moment, if that's important.
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
This e-mail and the information, including any attachments, it contains are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.
Thank you.
Please consider the environment before printing this email.
More information about the Qt-interest-old
mailing list