HI,
I've created a qt plugin with comboBox and lineEdit and put them in QHBoxLayout in Qt5. when i set sizepolicy of lineEdit to expanding, it doesn't works properly. actually it expands itself a little:
Untitled-4.png
my code in plugin constructor is something like below:
horizontalLayout->setMargin(1);
horizontalLayout->addWidget(lineEditValue,0,Qt::AlignLeft);
horizontalLayout->addWidget(comboBox,0,Qt::AlignRight);
this->setLayout(horizontalLayout);
comboBox = new QComboBox;
lineEditValue = new QLineEdit;
horizontalLayout = new QHBoxLayout(this);
horizontalLayout->setMargin(1);
comboBox->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Fixed);
lineEditValue->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed);
horizontalLayout->addWidget(lineEditValue,0,Qt::AlignLeft);
horizontalLayout->addWidget(comboBox,0,Qt::AlignRight);
this->setLayout(horizontalLayout);
To copy to clipboard, switch view to plain text mode
what i am missing?
Bookmarks