PDA

View Full Version : How to make a QString text underlined?



blonde
28th October 2009, 16:50
Hello,

How to make a QString text underlined?

for example:
you@gmail.com --> you@gmail.com

Thank you!

-B

jano_alex_es
28th October 2009, 17:27
QString is a string... just a type. Where do you want to underlyne it? where do you want to show the text? (QLabel, QGraphicsTextItem...)

blonde
28th October 2009, 17:56
in QLineEdit

squidge
28th October 2009, 23:23
In that case I'd say one possible solution is styleSheet property.

hashb
29th October 2009, 04:33
try this:
QString underline("<u>abc</u>");

jano_alex_es
29th October 2009, 08:19
I think you have to use QWidget::setStyle or QWidget::styleSheet

Example: change the backgroundcolor in a QLabel.

QString strStyle("background-color: Red");
mylabel->setStyleSheet(strStyle);