ThomasKwong
5th July 2012, 05:32
Hi All,
I'm the new blood on QT. I have a question on the class qtextedit. How can I know the max. number of lines that can be used in qtextedit without the scroll bar? That mean, I want to show the content as much as possible to the user who don't need to scroll up & down to see all message. Now, I think the calculation should be used for finding the max. line. The size of qtextedit can be found, but I can't find the exact size of text. It has a tolerance with +1 pixels by using textedit.fontMetrics().lineSpacing() .Also, I can't find the pixel distance at A as below. I can setup all correct factors for the calculation. Do any friends know how to calculation?
7950
Sorry for my bad English. As above case, I would like to show 2 lines, not 2.5 lines. If it is more than 2 lines, the rest of data are shown on the next qtextedit.
Thanks all,
Cheer,
Thomas
I'm the new blood on QT. I have a question on the class qtextedit. How can I know the max. number of lines that can be used in qtextedit without the scroll bar? That mean, I want to show the content as much as possible to the user who don't need to scroll up & down to see all message. Now, I think the calculation should be used for finding the max. line. The size of qtextedit can be found, but I can't find the exact size of text. It has a tolerance with +1 pixels by using textedit.fontMetrics().lineSpacing() .Also, I can't find the pixel distance at A as below. I can setup all correct factors for the calculation. Do any friends know how to calculation?
7950
Sorry for my bad English. As above case, I would like to show 2 lines, not 2.5 lines. If it is more than 2 lines, the rest of data are shown on the next qtextedit.
Thanks all,
Cheer,
Thomas