I have a TextEdit that shows only the lines it can be show (it is for a view-only editor I have ).
I calculate the max_lines = TextEdit.height()/ fontmetrics.height; (I have in mind the margins ).
I need a way to insert the textlines so for the first max_lines -1 I add \n and nothing for the last.
I have a char array, with max_lines size. I give the '\n' value for the first max_lines -1 but I dont know how to give null value to the last,
If I use '\0' , TextEdit shows me the typical vertical rectangle for unknowed characters.
( I use this array because I want to avoid an if statement ).
Any idea how can I do this ?
Thanks.
Bookmarks