16 #ifndef QGSRELATIONREFERENCEWIDGET_H
17 #define QGSRELATIONREFERENCEWIDGET_H
25 #include <QToolButton>
27 #include <QHBoxLayout>
28 #include <QStandardItemModel>
62 if ( qobject_cast<QgsRelationReferenceWidget *>( sipCpp ) )
63 sipType = sipType_QgsRelationReferenceWidget;
70 Q_PROPERTY(
bool openFormButtonVisible READ openFormButtonVisible WRITE setOpenFormButtonVisible )
85 void setRelation(
const QgsRelation &relation,
bool allowNullValue );
87 void setRelationEditable(
bool editable );
93 Q_DECL_DEPRECATED
void setForeignKey(
const QVariant &value )
SIP_DEPRECATED;
99 void setForeignKeys(
const QVariantList &values );
113 QVariantList foreignKeys() const;
123 bool embedForm() {
return mEmbedForm; }
124 void setEmbedForm(
bool display );
128 void setReadOnlySelector(
bool readOnly );
132 void setAllowMapIdentification(
bool allowMapIdentification );
137 void setOrderByValue(
bool orderByValue );
139 void setFilterFields(
const QStringList &filterFields );
143 void setOpenFormButtonVisible(
bool openFormButtonVisible );
158 void setChainFilters(
bool chainFilters );
169 void setFilterExpression(
const QString &filterExpression );
181 void showIndeterminateState();
188 bool allowAddFeatures()
const;
195 void setAllowAddFeatures(
bool allowAddFeatures );
208 void setFormFeature(
const QgsFeature &formFeature );
214 QString referencedLayerDataSource()
const;
220 void setReferencedLayerDataSource(
const QString &referencedLayerDataSource );
226 QString referencedLayerProviderKey()
const;
232 void setReferencedLayerProviderKey(
const QString &referencedLayerProviderKey );
238 QString referencedLayerId()
const;
244 void setReferencedLayerId(
const QString &referencedLayerId );
250 QString referencedLayerName()
const;
256 void setReferencedLayerName(
const QString &referencedLayerName );
263 void mapIdentification();
266 void deleteForeignKeys();
269 void showEvent( QShowEvent *e )
override;
288 void highlightActionTriggered( QAction *action );
289 void deleteHighlight();
290 void comboReferenceChanged();
291 void featureIdentified(
const QgsFeature &feature );
294 void mapToolDeactivated();
295 void filterChanged();
297 void updateAddEntryButton();
299 void onKeyPressed( QKeyEvent *e );
303 void updateAttributeEditorFrame(
const QgsFeature &feature );
304 void disableChainedComboBoxes(
const QComboBox *cb );
305 void emitForeignKeysChanged(
const QVariantList &foreignKeys,
bool force =
false );
311 QVariantList mForeignKeys;
315 QStringList mReferencedFields;
316 bool mAllowNull =
true;
326 QList<QComboBox *> mFilterComboBoxes;
327 QString mFilterExpression;
328 QWidget *mWindowWidget =
nullptr;
331 bool mIsEditable =
true;
332 QStringList mFilterFields;
333 QMap<QString, QMap<QString, QSet<QString> > > mFilterCache;
334 bool mInitialized =
false;
337 bool mEmbedForm =
false;
338 bool mReadOnlySelector =
false;
339 bool mAllowMapIdentification =
false;
340 bool mOrderByValue =
false;
341 bool mOpenFormButtonVisible =
true;
342 bool mChainFilters =
false;
343 bool mAllowAddFeatures =
false;
344 QString mReferencedLayerId;
345 QString mReferencedLayerName;
346 QString mReferencedLayerDataSource;
347 QString mReferencedLayerProviderKey;
350 QVBoxLayout *mTopLayout =
nullptr;
351 QToolButton *mMapIdentificationButton =
nullptr;
352 QToolButton *mRemoveFKButton =
nullptr;
353 QToolButton *mOpenFormButton =
nullptr;
354 QToolButton *mHighlightFeatureButton =
nullptr;
355 QToolButton *mAddEntryButton =
nullptr;
356 QAction *mHighlightFeatureAction =
nullptr;
357 QAction *mScaleHighlightFeatureAction =
nullptr;
358 QAction *mPanHighlightFeatureAction =
nullptr;
359 QWidget *mChooserContainer =
nullptr;
360 QWidget *mFilterContainer =
nullptr;
361 QHBoxLayout *mFilterLayout =
nullptr;
363 QVBoxLayout *mAttributeEditorLayout =
nullptr;
364 QLabel *mInvalidLabel =
nullptr;
366 friend class TestQgsRelationReferenceWidget;
This class contains context information for attribute editor widgets.
A groupbox that collapses/expands when toggled and can save its collapsed and checked states.
This offers a combobox with autocompleter that allows selecting features from a layer.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
A class for highlight features on the map.
Map canvas is a class for displaying all GIS data types on a canvas.
Represents an item shown within a QgsMessageBar widget.
A bar for displaying non-blocking messages to the user.
Represents a vector layer which manages a vector based data sets.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)