15#ifndef QGSFIELDVALUESLINEEDIT_H
16#define QGSFIELDVALUESLINEEDIT_H
26#include <QStringListModel>
44class QgsFieldValuesLineEditValuesGatherer :
public QThread
49 QgsFieldValuesLineEditValuesGatherer( QgsVectorLayer *layer,
int attributeIndex )
51 , mAttributeIndex( attributeIndex )
57 void setSubstring(
const QString &
string ) { mSubstring = string; }
65 bool wasCanceled()
const {
return mWasCanceled; }
73 void collectedValues(
const QStringList &values );
76 QgsVectorLayer *mLayer =
nullptr;
80 QgsFeedback *mFeedback =
nullptr;
81 QMutex mFeedbackMutex;
82 bool mWasCanceled =
false;
134 void setAttributeIndex(
int index );
163 void requestCompleterUpdate();
169 void triggerCompleterUpdate();
175 void updateCompleter(
const QStringList &values );
182 void gathererThreadFinished();
186 int mAttributeIndex = -1;
189 bool mUpdateRequested =
false;
192 QTimer mShowPopupTimer;
195 QgsFieldValuesLineEditValuesGatherer *mGatherer =
nullptr;
198 QString mRequestedCompletionText;
201 void updateCompletionList(
const QString &substring );
void attributeIndexChanged(int index)
Emitted when the field associated with the widget changes.
QgsFieldValuesLineEdit(QWidget *parent=nullptr)
Constructor for QgsFieldValuesLineEdit.
void setLayer(QgsVectorLayer *layer)
Sets the layer containing the field that values will be shown from.
void layerChanged(QgsVectorLayer *layer)
Emitted when the layer associated with the widget changes.
void setAttributeIndex(int index)
Sets the attribute index for the field containing values to show in the widget.
int attributeIndex() const
Returns the attribute index for the field containing values shown in the widget.
QgsFilterLineEdit(QWidget *parent=nullptr, const QString &nullValue=QString())
Constructor for QgsFilterLineEdit.
Represents a vector layer which manages a vector based dataset.