mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
bee2dea7cc
commit
fbd2160af2
2 changed files with 2 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue