16 #ifndef QGSFIELDLISTCOMBOBOX_H 17 #define QGSFIELDLISTCOMBOBOX_H 43 Q_PROPERTY(
QgsVectorLayer *sourceLayer READ sourceLayer WRITE setSourceLayer NOTIFY sourceLayerChanged )
44 Q_PROPERTY( QString displayExpression READ displayExpression WRITE setDisplayExpression NOTIFY displayExpressionChanged )
45 Q_PROPERTY( QString filterExpression READ filterExpression WRITE setFilterExpression NOTIFY filterExpressionChanged )
46 Q_PROPERTY( QVariant identifierValue READ identifierValue WRITE setIdentifierValue NOTIFY identifierValueChanged )
47 Q_PROPERTY( QString identifierField READ identifierField WRITE setIdentifierField NOTIFY identifierFieldChanged )
48 Q_PROPERTY(
bool allowNull READ allowNull WRITE setAllowNull NOTIFY allowNullChanged )
71 QString displayExpression() const;
77 void setDisplayExpression( const QString &displayExpression );
83 QString filterExpression() const;
91 int nullIndex() const;
99 void setFilterExpression( const QString &filterExpression );
105 QVariant identifierValue() const;
111 void setIdentifierValue( const QVariant &identifierValue );
122 bool allowNull() const;
127 void setAllowNull(
bool allowNull );
133 QString identifierField() const;
139 void setIdentifierField( const QString &identifierField );
144 QModelIndex currentModelIndex() const;
146 void focusOutEvent( QFocusEvent *event ) override;
148 void keyPressEvent( QKeyEvent *event ) override;
162 void sourceLayerChanged();
168 void displayExpressionChanged();
174 void filterExpressionChanged();
180 void identifierValueChanged();
186 void identifierFieldChanged();
191 void allowNullChanged();
194 void onCurrentTextChanged( const QString &text );
195 void onFilterUpdateCompleted();
196 void onLoadingChanged();
197 void onItemSelected( const QModelIndex &index );
198 void onCurrentIndexChanged(
int i );
199 void onActivated( QModelIndex index );
200 void storeLineEditState();
201 void restoreLineEditState();
202 void onDataChanged( const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<
int> &roles = QVector<
int>() );
207 void store( QLineEdit *lineEdit );
208 void restore( QLineEdit *lineEdit )
const;
217 QCompleter *mCompleter =
nullptr;
218 QString mDisplayExpression;
220 bool mPopupRequested =
false;
221 bool mIsCurrentlyEdited =
false;
222 bool mHasStoredEditState =
false;
223 LineEditState mLineEditState;
225 friend class TestQgsFeatureListComboBox;
228 #endif // QGSFIELDLISTCOMBOBOX_H Provides a list of features based on filter conditions.
This offers a combobox with autocompleter that allows selecting features from a layer.
This class wraps a request for features to a vector layer (or directly its vector data provider)...
QLineEdit subclass with built in support for clearing the widget's value and handling custom null val...
Animated icon is keeping an animation running if there are listeners connected to frameChanged...
Represents a vector layer which manages a vector based data sets.