Remove empty vertical space from filter QListWidget

In the filter the dropdown lists for selecting dive mode or day-of-week
has a lot of white space at the bottom. This PR removes that white space.
Actually the white space at the bottom of a QListWidget appears to
be a known bug (actually an omission) for the current Qt V15. The above
solution is a brute-force workaround to achieve the same end result.
The active line is actually the setFixedSize(). The other line, however,
comprises good QT layout policy to minimise widget size.

Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
This commit is contained in:
willemferguson 2020-09-30 09:58:29 +02:00 committed by Dirk Hohndel
parent b3f5473b66
commit a3e990dfd5

View file

@ -45,7 +45,9 @@ static QListWidget *makeMultipleChoice(const QModelIndex &index, int role)
return nullptr;
QListWidget *res = new QListWidget;
res->addItems(list);
res->setSizePolicy(QSizePolicy::Maximum,QSizePolicy::Maximum);
res->setSelectionMode(QAbstractItemView::ExtendedSelection);
res->setFixedSize(res->sizeHintForColumn(0) + 2 * res->frameWidth(), res->sizeHintForRow(0) * res->count() + 2 * res->frameWidth());
return res;
}