How to set real estate between two component in VboxLayout (solved)
-
In VBoxLayout, how to set the real estate between two component?
like 80% and 20%? instead of 50%-50%?QVBoxLayout *vbox=new QVBoxLayout(this); vbox->addWidget(lineEdit); vbox->addWidget(pTicker); setLayout(vbox);
-
Hi,
Set a "stretch factor":http://qt-project.org/doc/qt-5/layout.html#stretch-factors for each of your widgets
You can do that using QBoxLayout::insertWidget() or QBoxLayout::setStretchFactor(). See http://qt-project.org/doc/qt-5/qboxlayout.html for detailed documentation for those functions.