summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-09-10 10:42:00 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-09-10 08:58:03 -0700
commitfbd2160af249e260203c3f88db4da560cae26f75 (patch)
tree80da44049cd5c74cd4031143bc85c10456772d21
parentbee2dea7ccfcabff512b0a2d487dcab768fab8d9 (diff)
downloadsubsurface-fbd2160af249e260203c3f88db4da560cae26f75.tar.gz
desktop: make completion of equipment types substring search
User request: when entering a cylinder type, do a substring search. For example, when entering "100" also find "AL100". Currently, a starts-with search was used. This is simply done by setting the "filterMode" of the ComboBoxDelegate to "Qt::MatchContains". Suggested-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r--CHANGELOG.md1
-rw-r--r--desktop-widgets/modeldelegates.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1b63acb77..e8881c821 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,4 @@
+desktop: do substring search for equipment types
planner: properly initialize salinity
desktop: add an "Edit Gas Change" right-click option [#2910]
core: add support for Shearwater Peregrine (requires firmware V79 or newer)
diff --git a/desktop-widgets/modeldelegates.cpp b/desktop-widgets/modeldelegates.cpp
index 94162fd8f..0267cafcf 100644
--- a/desktop-widgets/modeldelegates.cpp
+++ b/desktop-widgets/modeldelegates.cpp
@@ -106,6 +106,7 @@ QWidget *ComboBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewI
comboDelegate->setEditable(true);
comboDelegate->completer()->setCaseSensitivity(Qt::CaseInsensitive);
comboDelegate->completer()->setCompletionMode(QCompleter::PopupCompletion);
+ comboDelegate->completer()->setFilterMode(Qt::MatchContains);
comboDelegate->view()->setEditTriggers(QAbstractItemView::AllEditTriggers);
comboDelegate->lineEdit()->installEventFilter(const_cast<QObject *>(qobject_cast<const QObject *>(this)));
comboDelegate->lineEdit()->setEnabled(editable);