Automatically change the width of the editbox and it's parent panel/dialog?
i want to automatically change the width of the editbox and its parent panel/dialog, and aotumatilly adjust the other controls on that panel/dialog.
is there any way to do this?
Do you need to resize the controls on a window resize?
If so, then take a look on "layouts":http://qt-project.org/doc/qt-5/layout.html
If not then you always can change a size of the widgets using "resize":http://qt-project.org/doc/qt-5/qwidget.html#size-prop method of QWidget
yeh, i know layouts.
I mean , when i input characters in the editbox, while the characters length increases, the editbox width increases, and the dialog which owns the editbox also increases,
can these width increase automatically?
or do i have to change the width always manually?
You need to change the widths manually.
If you use layouts then you need to change the width of dialog only.
If don't use layouts then you need to change all involved widgets.
I think flowLayout is suitable.
but is there any way to get the whole widht of one row(eg. the 1st row)?
cause there may be a lable and an editbox and so on in a row.
and what i want is just increase the editbox's width. while the other controls such as lable's width stays unchanged.