PDA

View Full Version : how to adjust the text browser size dynamically while displaying a file in a window?



aurora
18th October 2011, 06:08
Hi,
I'm trying to displaying a file content in a window using textBrowser, but i'm not able to display properly....Single line is splitting into two lines and unable to view the file contents properly...how can i adjust the textBrowser size dynamically? it has to set depending on file content..

starkid
18th October 2011, 11:02
Perhaps you could define a slot that uses the resize() or setGeomtry functions, and trigger it with the textChanged signal...but you would need some way to pass the number of characters or something if you want to change the widget size precisely.

Alternatively, if you just want to control how the text is wrapping without changing the size of the widget, you could take a look at changing the LineWrapMode property.