PDA

View Full Version : To underline the numbers behind the decimal points?



wookoon
14th December 2010, 07:35
In some stock software some figure showing this way:12.01

How can I do it with QT?

stampede
14th December 2010, 07:58
If you want to display this text in QLabel, you can use html tags to underline a part of the text, just use:


QLabel::setText("<u>my text</u>");

You can create needed text given a real number using the basic arithmetical operations and QString::number() method. ( a hint: 12.01 = 12 + 0.01 :rolleyes:)

wookoon
14th December 2010, 08:22
If in stock software, I think figure showed maybe in QTableView or others.

ChrisW67
14th December 2010, 23:01
If this has to happen in item views then you would need to write a delegate to paint the text appropriately.