From a3e990dfd5a17ab541e3ab89a21b80d8bc48bb6e Mon Sep 17 00:00:00 2001 From: willemferguson Date: Wed, 30 Sep 2020 09:58:29 +0200 Subject: 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 --- desktop-widgets/filterconstraintwidget.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'desktop-widgets') diff --git a/desktop-widgets/filterconstraintwidget.cpp b/desktop-widgets/filterconstraintwidget.cpp index 8cc8f130a..441ab73ea 100644 --- a/desktop-widgets/filterconstraintwidget.cpp +++ b/desktop-widgets/filterconstraintwidget.cpp @@ -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; } -- cgit v1.2.3-70-g09d2