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 );
84 QMutex mFeedbackMutex;
103 Q_PROPERTY(
QgsVectorLayer *layer READ layer WRITE setLayer NOTIFY layerChanged )
104 Q_PROPERTY(
int attributeIndex READ attributeIndex WRITE setAttributeIndex NOTIFY attributeIndexChanged )
137 void setAttributeIndex(
int index );
166 void requestCompleterUpdate();
172 void triggerCompleterUpdate();
178 void updateCompleter(
const QStringList &values );
185 void gathererThreadFinished();
190 int mAttributeIndex = -1;
193 bool mUpdateRequested =
false;
196 QTimer mShowPopupTimer;
199 QgsFieldValuesLineEditValuesGatherer *mGatherer =
nullptr;
202 QString mRequestedCompletionText;
205 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.