spacer = new QSpacerItem(1, 10, QSizePolicy::Minimum, QSizePolicy::Preferred);
есть QGridLayout,
создается вот так вот, и добавление распорки:
thresholdCloseLayout = new QGridLayout();
thresholdCloseLayout->addItem(this->spacer,1,0,1,1);
thresholdCloseLayout->addWidget(this->thresholdCloseLabel,0, 0, 1, 1);
thresholdCloseLayout->addWidget(this->thresholdCloseSpinBox,0, 1, 1, 1);
thresholdCloseLayout->addWidget(this->thresholdCloseSlider, 1, 1, 1, 1);
thresholdCloseLayout->addWidget(this->visualClustersView,2, 0, 1,2 );
И по определенному сигналу, должна изменяться ширина распорки(по логике) :
void View::resizeSpacer(int newSize)
{
QRect *rect = new QRect(
this->spacer->geometry().left(),
this->spacer->geometry().top(),
newSize,
this->spacer->geometry().height()
);
this->spacer->setGeometry(*rect);
}
Но изменений ширины не происходит.почему?
Что-то вроде того, что лейаут сам определяет ширину распорки?а как этого избежать?