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 );
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 );
292 void updateAttributeEditorFrame(
const QgsFeature &feature );
293 void disableChainedComboBoxes(
const QComboBox *cb );
294 void emitForeignKeysChanged(
const QVariantList &foreignKeys,
bool force =
false );
300 QVariantList mForeignKeys;
304 QStringList mReferencedFields;
305 bool mAllowNull =
true;
315 QList<QComboBox *> mFilterComboBoxes;
316 QWidget *mWindowWidget =
nullptr;
319 bool mIsEditable =
true;
320 QStringList mFilterFields;
321 QMap<QString, QMap<QString, QSet<QString> > > mFilterCache;
322 bool mInitialized =
false;
325 bool mEmbedForm =
false;
326 bool mReadOnlySelector =
false;
327 bool mAllowMapIdentification =
false;
328 bool mOrderByValue =
false;
329 bool mOpenFormButtonVisible =
true;
330 bool mChainFilters =
false;
331 bool mAllowAddFeatures =
false;
332 QString mReferencedLayerId;
333 QString mReferencedLayerName;
334 QString mReferencedLayerDataSource;
335 QString mReferencedLayerProviderKey;
338 QVBoxLayout *mTopLayout =
nullptr;
339 QToolButton *mMapIdentificationButton =
nullptr;
340 QToolButton *mRemoveFKButton =
nullptr;
341 QToolButton *mOpenFormButton =
nullptr;
342 QToolButton *mHighlightFeatureButton =
nullptr;
343 QToolButton *mAddEntryButton =
nullptr;
344 QAction *mHighlightFeatureAction =
nullptr;
345 QAction *mScaleHighlightFeatureAction =
nullptr;
346 QAction *mPanHighlightFeatureAction =
nullptr;
347 QWidget *mChooserContainer =
nullptr;
348 QWidget *mFilterContainer =
nullptr;
349 QHBoxLayout *mFilterLayout =
nullptr;
351 QVBoxLayout *mAttributeEditorLayout =
nullptr;
352 QLineEdit *mLineEdit =
nullptr;
353 QLabel *mInvalidLabel =
nullptr;
355 friend class TestQgsRelationReferenceWidget;
358 #endif // QGSRELATIONREFERENCEWIDGET_H