In a QVBoxLayout :
Is it possible both to align left/right and keep the stretching value of a given widget ?
In a QVBoxLayout :
Is it possible both to align left/right and keep the stretching value of a given widget ?
Align what? The vertical layout aligns vertically, so no left-right here... And what do you mean by "stretching value"?
My bad, I was asking with QHBoxLayout in mind.
Qt Code:
mHBoxLayout->AddWidget(lineEdit, 10, Qt::AlignLeft);To copy to clipboard, switch view to plain text mode
In this case the "stretching value" is 10 and the widget is aligned on the left.
Problem is since it's aligned to the left it wont stretch anymore.
What if for example we want the widget to expand to a certain value without occupying the whole space of a layout.
I'm not sure I'm making sense so let me give you an example :
If I have a QTextEdit paragraph and I want to align the paragraph to the left by keeping the stretching at the same time. How am I suppose to achieve this ? in the layout ? in the QTextEdit widget ?
Thanks.
The stretch factor only makes sense if you have more widgets in the layout. If you want to limit the expansion of a widget, just set its maximum size.
Bookmarks