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;
 
  103    Q_PROPERTY( 
QgsVectorLayer *layer READ layer WRITE setLayer NOTIFY layerChanged )
 
  104    Q_PROPERTY( 
int attributeIndex READ attributeIndex WRITE setAttributeIndex NOTIFY attributeIndexChanged )
 
  136    void setAttributeIndex( 
int index );
 
  165    void requestCompleterUpdate();
 
  171    void triggerCompleterUpdate();
 
  177    void updateCompleter( 
const QStringList &values );
 
  184    void gathererThreadFinished();
 
  188    int mAttributeIndex = -1;
 
  191    bool mUpdateRequested = 
false;
 
  194    QTimer mShowPopupTimer;
 
  197    QgsFieldValuesLineEditValuesGatherer *mGatherer = 
nullptr;
 
  200    QString mRequestedCompletionText;
 
  203    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 dataset.