15#ifndef QGSFIELDVALUESLINEEDIT_H
16#define QGSFIELDVALUESLINEEDIT_H
22#include <QStringListModel>
45class QgsFieldValuesLineEditValuesGatherer :
public QThread
50 QgsFieldValuesLineEditValuesGatherer(
QgsVectorLayer *layer,
int attributeIndex )
52 , mAttributeIndex( attributeIndex )
53 , mWasCanceled( false )
59 void setSubstring(
const QString &
string ) { mSubstring = string; }
67 bool wasCanceled()
const {
return mWasCanceled; }
75 void collectedValues(
const QStringList &values );
83 QMutex mFeedbackMutex;
102 Q_PROPERTY(
QgsVectorLayer *layer READ layer WRITE setLayer NOTIFY layerChanged )
103 Q_PROPERTY(
int attributeIndex READ attributeIndex WRITE setAttributeIndex NOTIFY attributeIndexChanged )
135 void setAttributeIndex(
int index );
164 void requestCompleterUpdate();
170 void triggerCompleterUpdate();
176 void updateCompleter(
const QStringList &values );
183 void gathererThreadFinished();
187 int mAttributeIndex = -1;
190 bool mUpdateRequested =
false;
193 QTimer mShowPopupTimer;
196 QgsFieldValuesLineEditValuesGatherer *mGatherer =
nullptr;
199 QString mRequestedCompletionText;
202 void updateCompletionList(
const QString &substring );
Base class for feedback objects to be used for cancellation of something running in a worker thread.
A line edit with an autocompleter which takes unique values from a vector layer's fields.
void attributeIndexChanged(int index)
Emitted when the field associated with the widget changes.
void layerChanged(QgsVectorLayer *layer)
Emitted when the layer associated with the widget changes.
int attributeIndex() const
Returns the attribute index for the field containing values shown in the widget.
QLineEdit subclass with built in support for clearing the widget's value and handling custom null val...
Represents a vector layer which manages a vector based data sets.