Skip to content

Commit 94b0de5

Browse files
committed
Improved search for the relation reference widget
1 parent 86afa4e commit 94b0de5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/gui/editorwidgets/qgsrelationreferencewidget.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <QDialog>
2020
#include <QHBoxLayout>
2121
#include <QTimer>
22+
#include <QCompleter>
2223

2324
#include "qgsattributeform.h"
2425
#include "qgsattributetablefiltermodel.h"
@@ -543,6 +544,14 @@ void QgsRelationReferenceWidget::init()
543544

544545
mComboBox->setModel( mFeatureListModel );
545546

547+
delete mComboBox->completer();
548+
QCompleter* completer = new QCompleter( mComboBox->model(), mComboBox );
549+
completer->setModel( mComboBox->model() );
550+
completer->setFilterMode( Qt::MatchContains );
551+
completer->setCaseSensitivity( Qt::CaseInsensitive );
552+
mComboBox->setCompleter( completer );
553+
554+
546555
QVariant nullValue = QSettings().value( QStringLiteral( "qgis/nullValue" ), "NULL" );
547556

548557
if ( mChainFilters && mFeature.isValid() )

0 commit comments

Comments
 (0)