shenjoku
07-09-2011 03:42:38
I'm trying to figure out a way to size an Edit widget to the size of the text inside of it. The widget is clamped at the parent size and word wrap is enabled so all I need now is to make the height of the Edit widget update so it fits however tall the text ends up being. Is there any way to do this? I haven't found any obvious solutions yet.
EDIT: Found a solution after looking around for a while. After setting the text on the Edit widget using setCaption() if you use editWidget->getHeight() + editWidget()->getVScrollRange() you will get the height needed to fit the text.
EDIT: Found a solution after looking around for a while. After setting the text on the Edit widget using setCaption() if you use editWidget->getHeight() + editWidget()->getVScrollRange() you will get the height needed to fit the text.