Details
-
Suggestion
-
Resolution: Unresolved
-
P5: Not important
-
None
-
None
Description
Customer request is to get better documentation with example or hint how to initialize widgets sizes.
Background for the request is that if widget has bigger minimumsize hint than given size then it it won't set the size. That cause some confusion if it's wanted to use relative small sizes, like (1,2,3)
It's documented, http://doc.qt.io/qt-5/qsplitter.html#setSizes:
"If you specify a size of 0, the widget will be invisible. The size policies of the widgets are preserved. That is, a value smaller than the minimal size hint of the respective widget will be replaced by the value of the hint."
So the hint/example would be to set widgets minimumsize before calling splitter setSizes:
for(int i=0;i<3;i++) { QTextEdit *widget = new QTextEdit(); widget->setMinimumSize(1,1); // set minimum size 1 splitter->addWidget(widget); } splitter->setSizes(QList<int>() << 1 << 2 << 100); // relative sizes