I have a custumWidget
which displays 3 QLineEdits. These customWidget
s are stored inside a QListWidget like this:
QListWidgetItem* item = new QListWidgetItem();
ui->listWidget->insertItem(index, item);
ui->listWidget->setItemWidget(item, customWidget);
I set a minimum size within the customWidget
:
ui->lineEndit->setMinimumSize(50, 200);
But when I resize the window, I can resize it even smaller than the stipulated minimumSize
. Does my minimumSize
get lost/ignored (for example, in my customWidget
)?
I'm using Qt 5.1 and C++11.
You should set the size policy for the line edit according to your needs. Take a look at
enum QSizePolicy::Policy
to find the right size policy.