16 #include <QItemDelegate> 20 #include <QToolButton> 97 newValue = eww->
value();
99 if (( oldValue != newValue && newValue.
isValid() ) || oldValue.
isNull() != newValue.
isNull() )
127 mFeatureSelectionModel = featureSelectionModel;
146 myOpt.font.setItalic(
true );
147 myOpt.palette.setColor( QPalette::Text,
QColor(
"gray" ) );
150 if ( mFeatureSelectionModel && mFeatureSelectionModel->
isSelected( fid ) )
151 myOpt.state |= QStyle::State_Selected;
155 if ( option.state & QStyle::State_HasFocus )
157 QRect r = option.rect.adjusted( 1, 1, -1, -1 );
bool isValid() const
Returns the validity of this feature.
qlonglong toLongLong(bool *ok) const
QgsVectorLayer * layer() const
Returns the layer this filter acts on.
QgsVectorLayer * layer() const
Returns the layer this model uses as backend.
virtual bool isSelected(QgsFeatureId fid)
Returns the selection status of a given feature id.
QgsAttributeTableModel * masterModel() const
Returns the table model this filter is using.
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Overloads the paint method form the QItemDelegate base class.
Get the field index of this column.
void beginEditCommand(const QString &text)
Create edit command for undo/redo operations.
This class contains context information for attribute editor widgets.
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest())
Query the provider for features specified in request.
QgsFeatureRequest & setSubsetOfAttributes(const QgsAttributeList &attrs)
Set a subset of attributes that will be fetched.
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
A model backed by a QgsVectorLayerCache which is able to provide feature/attribute information to a Q...
void actionColumnItemPainted(const QModelIndex &index) const
Is emitted when an action column item is painted.
QString tr(const char *sourceText, const char *disambiguation, int n)
void setFeatureSelectionModel(QgsFeatureSelectionModel *featureSelectionModel)
QgsEditFormConfig * editFormConfig() const
Get the configuration of the form used to represent this vector layer.
Get the feature id of the feature in this row.
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Used to create an editor for when the user tries to change the contents of a cell.
void drawRect(const QRectF &rectangle)
A widget was opened as a popup (e.g. attribute table editor widget)
QVariantMap QgsEditorWidgetConfig
Holds a set of configuration parameters for a editor widget wrapper.
void setEditorData(QWidget *editor, const QModelIndex &index) const override
Sets data from model into the editor.
int toInt(bool *ok) const
void setPen(const QColor &color)
This class wraps a request for features to a vector layer (or directly its vector data provider)...
QList< int > QgsAttributeList
virtual QVariant data(const QModelIndex &index, int role) const=0
QgsFeatureRequest & setFlags(const QgsFeatureRequest::Flags &flags)
Set flags that affect how features will be fetched.
This column shows action buttons.
Q_DECL_DEPRECATED bool changeAttributeValue(QgsFeatureId fid, int field, const QVariant &value, bool emitSignal)
Changes an attribute value (but does not commit it)
void endEditCommand()
Finish edit command and add it to undo/redo stack.
const QAbstractItemModel * model() const
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
Sets data from editor back to model.
ColumnType
The type of a column.
bool nextFeature(QgsFeature &f)
Geometry is not required. It may still be returned if e.g. required for a filter condition.
The type of a given column.
Represents a vector layer which manages a vector based data sets.