16#ifndef QGSVALUERELATIONWIDGETWRAPPER_H
17#define QGSVALUERELATIONWIDGETWRAPPER_H
19#include <QTableWidget>
40class QgsFilteredTableWidget :
public QWidget
51 QgsFilteredTableWidget( QWidget *parent,
bool showSearch,
bool displayGroupName );
53 bool eventFilter( QObject *watched, QEvent *event )
override;
58 QStringList selection()
const;
63 void checkItems(
const QStringList &checked );
73 void setIndeterminateState();
78 void setEnabledTable(
const bool enabled );
83 void setColumnCount(
const int count );
88 int rowCount()
const {
return mTableWidget->rowCount(); }
95 void itemChanged( QTableWidgetItem *item );
98 void filterStringChanged(
const QString &filterString );
99 void itemChanged_p( QTableWidgetItem *item );
100 QTableWidgetItem *item(
const int row,
const int column )
const {
return mTableWidget->item( row, column ); }
102 int mColumnCount = 1;
104 QTableWidget *mTableWidget =
nullptr;
105 bool mEnabledTable =
true;
106 QVector<QPair<QgsValueRelationFieldFormatter::ValueRelationItem, Qt::CheckState>> mCache;
107 bool mDisplayGroupName =
false;
109 friend class TestQgsValueRelationWidgetWrapper;
152 QVariant
value()
const override;
165 bool valid()
const override;
179 void widgetValueChanged(
const QString &attribute,
const QVariant &newValue,
bool attributeChanged );
192 void emitValueChangedInternal(
const QString &value );
195 void updateValues(
const QVariant &value,
const QVariantList & = QVariantList() )
override;
207 void updateValue(
const QVariant &value,
bool forceComboInsertion );
213 int columnCount()
const;
216 QMetaType::Type fkType()
const;
221 QComboBox *mComboBox =
nullptr;
222 QgsFilteredTableWidget *mTableWidget =
nullptr;
223 QLineEdit *mLineEdit =
nullptr;
224 int mSubWidgetSignalBlocking = 0;
228 bool mEnabled =
true;
232 friend class TestQgsValueRelationWidgetWrapper;
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
QLineEdit subclass with built in support for clearing the widget's value and handling custom null val...
Represents a vector layer which manages a vector based data sets.