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 );
105 Q_DECL_DEPRECATED QVariant foreignKey() const SIP_DEPRECATED;
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 );
170 void showIndeterminateState();
177 bool allowAddFeatures()
const;
184 void setAllowAddFeatures(
bool allowAddFeatures );
197 void setFormFeature(
const QgsFeature &formFeature );
203 QString referencedLayerDataSource()
const;
209 void setReferencedLayerDataSource(
const QString &referencedLayerDataSource );
215 QString referencedLayerProviderKey()
const;
221 void setReferencedLayerProviderKey(
const QString &referencedLayerProviderKey );
227 QString referencedLayerId()
const;
233 void setReferencedLayerId(
const QString &referencedLayerId );
239 QString referencedLayerName()
const;
245 void setReferencedLayerName(
const QString &referencedLayerName );
252 void mapIdentification();
255 void deleteForeignKeys();
258 void showEvent( QShowEvent *e )
override;
268 Q_DECL_DEPRECATED
void foreignKeyChanged(
const QVariant & )
SIP_DEPRECATED;
274 void foreignKeysChanged(
const QVariantList & );
277 void highlightActionTriggered( QAction *action );
278 void deleteHighlight();
279 void comboReferenceChanged(
int index );
280 void featureIdentified(
const QgsFeature &feature );
283 void mapToolDeactivated();
284 void filterChanged();
286 void updateAddEntryButton();
288 void onKeyPressed( QKeyEvent *e );
298 void updateAttributeEditorFrame(
const QgsFeature &feature );
299 void disableChainedComboBoxes(
const QComboBox *cb );
300 void emitForeignKeysChanged(
const QVariantList &foreignKeys,
bool force =
false );
306 QVariantList mForeignKeys;
310 QStringList mReferencedFields;
311 bool mAllowNull =
true;
321 QList<QComboBox *> mFilterComboBoxes;
322 QWidget *mWindowWidget =
nullptr;
325 bool mIsEditable =
true;
326 QStringList mFilterFields;
327 QMap<QString, QMap<QString, QSet<QString> > > mFilterCache;
328 bool mInitialized =
false;
331 bool mEmbedForm =
false;
332 bool mReadOnlySelector =
false;
333 bool mAllowMapIdentification =
false;
334 bool mOrderByValue =
false;
335 bool mOpenFormButtonVisible =
true;
336 bool mChainFilters =
false;
337 bool mAllowAddFeatures =
false;
338 QString mReferencedLayerId;
339 QString mReferencedLayerName;
340 QString mReferencedLayerDataSource;
341 QString mReferencedLayerProviderKey;
344 QVBoxLayout *mTopLayout =
nullptr;
345 QToolButton *mMapIdentificationButton =
nullptr;
346 QToolButton *mRemoveFKButton =
nullptr;
347 QToolButton *mOpenFormButton =
nullptr;
348 QToolButton *mHighlightFeatureButton =
nullptr;
349 QToolButton *mAddEntryButton =
nullptr;
350 QAction *mHighlightFeatureAction =
nullptr;
351 QAction *mScaleHighlightFeatureAction =
nullptr;
352 QAction *mPanHighlightFeatureAction =
nullptr;
353 QWidget *mChooserContainer =
nullptr;
354 QWidget *mFilterContainer =
nullptr;
355 QHBoxLayout *mFilterLayout =
nullptr;
357 QVBoxLayout *mAttributeEditorLayout =
nullptr;
358 QLineEdit *mLineEdit =
nullptr;
359 QLabel *mInvalidLabel =
nullptr;
361 friend class TestQgsRelationReferenceWidget;
364 #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.