16 #ifndef QGSRELATIONREFERENCEWIDGET_H 17 #define QGSRELATIONREFERENCEWIDGET_H 24 #include <QToolButton> 26 #include <QHBoxLayout> 27 #include <QStandardItemModel> 59 if ( qobject_cast<QgsRelationReferenceWidget *>( sipCpp ) )
60 sipType = sipType_QgsRelationReferenceWidget;
67 Q_PROPERTY(
bool openFormButtonVisible READ openFormButtonVisible WRITE setOpenFormButtonVisible )
82 void setRelation(
const QgsRelation &relation,
bool allowNullValue );
84 void setRelationEditable(
bool editable );
87 void setForeignKey(
const QVariant &value );
90 QVariant foreignKey()
const;
96 void setEmbedForm(
bool display );
100 void setReadOnlySelector(
bool readOnly );
104 void setAllowMapIdentification(
bool allowMapIdentification );
109 void setOrderByValue(
bool orderByValue );
111 void setFilterFields(
const QStringList &filterFields );
115 void setOpenFormButtonVisible(
bool openFormButtonVisible );
130 void setChainFilters(
bool chainFilters );
142 void showIndeterminateState();
149 bool allowAddFeatures()
const;
156 void setAllowAddFeatures(
bool allowAddFeatures );
163 void mapIdentification();
166 void deleteForeignKey();
169 void showEvent( QShowEvent *e )
override;
174 void foreignKeyChanged(
const QVariant & );
177 void highlightActionTriggered( QAction *action );
178 void deleteHighlight();
179 void comboReferenceChanged(
int index );
180 void featureIdentified(
const QgsFeature &feature );
182 void mapToolDeactivated();
183 void filterChanged();
185 void updateAddEntryButton();
195 void updateAttributeEditorFrame(
const QgsFeature &feature );
196 void disableChainedComboBoxes(
const QComboBox *cb );
197 void emitForeignKeyChanged(
const QVariant &foreignKey );
203 QVariant mForeignKey;
206 int mReferencedFieldIdx = -1;
207 QString mReferencedField;
208 int mReferencingFieldIdx = -1;
209 bool mAllowNull =
true;
213 QString mRelationName;
218 QList<QComboBox *> mFilterComboBoxes;
219 QWidget *mWindowWidget =
nullptr;
222 bool mIsEditable =
true;
223 QStringList mFilterFields;
224 QMap<QString, QMap<QString, QSet<QString> > > mFilterCache;
227 bool mEmbedForm =
false;
228 bool mReadOnlySelector =
false;
229 bool mAllowMapIdentification =
false;
230 bool mOrderByValue =
false;
231 bool mOpenFormButtonVisible =
true;
232 bool mChainFilters =
false;
233 bool mAllowAddFeatures =
false;
236 QVBoxLayout *mTopLayout =
nullptr;
237 QToolButton *mMapIdentificationButton =
nullptr;
238 QToolButton *mRemoveFKButton =
nullptr;
239 QToolButton *mOpenFormButton =
nullptr;
240 QToolButton *mHighlightFeatureButton =
nullptr;
241 QToolButton *mAddEntryButton =
nullptr;
242 QAction *mHighlightFeatureAction =
nullptr;
243 QAction *mScaleHighlightFeatureAction =
nullptr;
244 QAction *mPanHighlightFeatureAction =
nullptr;
245 QWidget *mChooserContainer =
nullptr;
246 QWidget *mFilterContainer =
nullptr;
247 QHBoxLayout *mFilterLayout =
nullptr;
249 QVBoxLayout *mAttributeEditorLayout =
nullptr;
250 QLineEdit *mLineEdit =
nullptr;
251 QLabel *mInvalidLabel =
nullptr;
253 friend class TestQgsRelationReferenceWidget;
256 #endif // QGSRELATIONREFERENCEWIDGET_H
This offers a combobox with autocompleter that allows selecting features from a layer.
A groupbox that collapses/expands when toggled and can save its collapsed and checked states...
This class contains context information for attribute editor widgets.
A bar for displaying non-blocking messages to the user.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Map canvas is a class for displaying all GIS data types on a canvas.
A class for highlight features on the map.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Represents a vector layer which manages a vector based data sets.