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 void setFilterExpression( const QString &filterExpression );
97 QVariant identifierValue() const;
103 void setIdentifierValue( const QVariant &identifierValue );
114 bool allowNull() const;
119 void setAllowNull(
bool allowNull );
125 QString identifierField() const;
131 void setIdentifierField( const QString &identifierField );
136 QModelIndex currentModelIndex() const;
138 void focusOutEvent( QFocusEvent *event ) override;
140 void keyPressEvent( QKeyEvent *event ) override;
147 void sourceLayerChanged();
153 void displayExpressionChanged();
159 void filterExpressionChanged();
165 void identifierValueChanged();
171 void identifierFieldChanged();
176 void allowNullChanged();
179 void onCurrentTextChanged( const QString &text );
180 void onFilterUpdateCompleted();
181 void onLoadingChanged();
182 void onItemSelected( const QModelIndex &index );
183 void onCurrentIndexChanged(
int i );
184 void onActivated( QModelIndex index );
185 void storeLineEditState();
186 void restoreLineEditState();
187 void onDataChanged( const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<
int> &roles = QVector<
int>() );
192 void store( QLineEdit *lineEdit );
193 void restore( QLineEdit *lineEdit )
const;
202 QCompleter *mCompleter =
nullptr;
203 QString mDisplayExpression;
205 bool mPopupRequested =
false;
206 bool mIsCurrentlyEdited =
false;
207 LineEditState mLineEditState;
210 #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.