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

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

How can I do it with QT?

14th December 2010, 08: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:)

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

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