16 #include <QItemDelegate>
98 newValue = eww->
value();
100 if (( oldValue != newValue && newValue.
isValid() ) || oldValue.
isNull() != newValue.
isNull() )
119 mFeatureSelectionModel = featureSelectionModel;
132 myOpt.font.setItalic(
true );
133 myOpt.palette.setColor( QPalette::Text,
QColor(
"gray" ) );
136 if ( mFeatureSelectionModel && mFeatureSelectionModel->
isSelected( fid ) )
137 myOpt.state |= QStyle::State_Selected;
141 if ( option.state & QStyle::State_HasFocus )
143 QRect r = option.rect.adjusted( 1, 1, -1, -1 );
const QgsEditorWidgetConfig editorWidgetV2Config(int fieldIdx) const
Get the configuration for the editor widget used to represent the field at the given index...
qlonglong toLongLong(bool *ok) const
bool fieldEditable(int idx)
is edit widget editable
virtual bool isSelected(QgsFeatureId fid)
Returns the selection status of a given feature id.
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Overloads the paint method form the QItemDelegate bas class.
This class contains context information for attribute editor widgets.
void beginEditCommand(QString text)
Create edit command for undo/redo operations.
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
A model backed by a QgsVectorLayerCache which is able to provide feature/attribute information to a Q...
QString tr(const char *sourceText, const char *disambiguation, int n)
void setFeatureSelectionModel(QgsFeatureSelectionModel *featureSelectionModel)
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.
QgsVectorLayer * layer() const
Returns the layer this filter acts on.
void drawRect(const QRectF &rectangle)
A widget was opened as a popup (e.g. attribute table editor widget)
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)
const QString editorWidgetV2(int fieldIdx) const
Get the id for the editor widget used to represent the field at the given index.
Q_DECL_DEPRECATED bool changeAttributeValue(QgsFeatureId fid, int field, QVariant value, bool emitSignal)
Changes an attribute value (but does not commit it)
virtual QVariant data(const QModelIndex &index, int role) const =0
void endEditCommand()
Finish edit command and add it to undo/redo stack.
QgsAttributeTableModel * masterModel() const
Returns the table model this filter is using.
const QAbstractItemModel * model() const
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
Sets data from editor back to model.
QgsVectorLayer * layer() const
Returns the layer this model uses as backend.
Represents a vector layer which manages a vector based data sets.