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;
225 bool mInitialized =
false;
228 bool mEmbedForm =
false;
229 bool mReadOnlySelector =
false;
230 bool mAllowMapIdentification =
false;
231 bool mOrderByValue =
false;
232 bool mOpenFormButtonVisible =
true;
233 bool mChainFilters =
false;
234 bool mAllowAddFeatures =
false;
237 QVBoxLayout *mTopLayout =
nullptr;
238 QToolButton *mMapIdentificationButton =
nullptr;
239 QToolButton *mRemoveFKButton =
nullptr;
240 QToolButton *mOpenFormButton =
nullptr;
241 QToolButton *mHighlightFeatureButton =
nullptr;
242 QToolButton *mAddEntryButton =
nullptr;
243 QAction *mHighlightFeatureAction =
nullptr;
244 QAction *mScaleHighlightFeatureAction =
nullptr;
245 QAction *mPanHighlightFeatureAction =
nullptr;
246 QWidget *mChooserContainer =
nullptr;
247 QWidget *mFilterContainer =
nullptr;
248 QHBoxLayout *mFilterLayout =
nullptr;
250 QVBoxLayout *mAttributeEditorLayout =
nullptr;
251 QLineEdit *mLineEdit =
nullptr;
252 QLabel *mInvalidLabel =
nullptr;
254 friend class TestQgsRelationReferenceWidget;
257 #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.