summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar willemferguson <willemferguson@zoology.up.ac.za>2020-09-30 09:58:29 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-10-05 13:36:29 -0700
commita3e990dfd5a17ab541e3ab89a21b80d8bc48bb6e (patch)
tree38c9593c6e44732ac2628343731ef2795ffcde6d /desktop-widgets
parentb3f5473b66b8210d1276f197876e0e2d7bbd6fa7 (diff)
downloadsubsurface-a3e990dfd5a17ab541e3ab89a21b80d8bc48bb6e.tar.gz
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>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/filterconstraintwidget.cpp2
1 files changed, 2 insertions, 0 deletions
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;
}