31
31
#include " qgsactionmanager.h"
32
32
33
33
34
- QgsVectorLayer* QgsAttributeTableDelegate::layer ( const QAbstractItemModel *model )
34
+ QgsVectorLayer * QgsAttributeTableDelegate::layer ( const QAbstractItemModel *model )
35
35
{
36
36
const QgsAttributeTableModel *tm = qobject_cast<const QgsAttributeTableModel *>( model );
37
37
if ( tm )
@@ -44,7 +44,7 @@ QgsVectorLayer* QgsAttributeTableDelegate::layer( const QAbstractItemModel *mode
44
44
return nullptr ;
45
45
}
46
46
47
- const QgsAttributeTableModel* QgsAttributeTableDelegate::masterModel ( const QAbstractItemModel* model )
47
+ const QgsAttributeTableModel * QgsAttributeTableDelegate::masterModel ( const QAbstractItemModel * model )
48
48
{
49
49
const QgsAttributeTableModel *tm = qobject_cast<const QgsAttributeTableModel *>( model );
50
50
if ( tm )
@@ -57,7 +57,7 @@ const QgsAttributeTableModel* QgsAttributeTableDelegate::masterModel( const QAbs
57
57
return nullptr ;
58
58
}
59
59
60
- QWidget* QgsAttributeTableDelegate::createEditor ( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const
60
+ QWidget * QgsAttributeTableDelegate::createEditor ( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const
61
61
{
62
62
Q_UNUSED ( option );
63
63
QgsVectorLayer *vl = layer ( index.model () );
@@ -67,8 +67,8 @@ QWidget* QgsAttributeTableDelegate::createEditor( QWidget *parent, const QStyleO
67
67
int fieldIdx = index.model ()->data ( index, QgsAttributeTableModel::FieldIndexRole ).toInt ();
68
68
69
69
QgsAttributeEditorContext context ( masterModel ( index.model () )->editorContext (), QgsAttributeEditorContext::Popup );
70
- QgsEditorWidgetWrapper* eww = QgsEditorWidgetRegistry::instance ()->create ( vl, fieldIdx, nullptr , parent, context );
71
- QWidget* w = eww->widget ();
70
+ QgsEditorWidgetWrapper * eww = QgsEditorWidgetRegistry::instance ()->create ( vl, fieldIdx, nullptr , parent, context );
71
+ QWidget * w = eww->widget ();
72
72
73
73
w->setAutoFillBackground ( true );
74
74
w->setFocusPolicy ( Qt::StrongFocus ); // to make sure QMouseEvents are propagated to the editor widget
@@ -89,13 +89,13 @@ void QgsAttributeTableDelegate::setModelData( QWidget *editor, QAbstractItemMode
89
89
QVariant oldValue = model->data ( index, Qt::EditRole );
90
90
91
91
QVariant newValue;
92
- QgsEditorWidgetWrapper* eww = QgsEditorWidgetWrapper::fromWidget ( editor );
92
+ QgsEditorWidgetWrapper * eww = QgsEditorWidgetWrapper::fromWidget ( editor );
93
93
if ( !eww )
94
94
return ;
95
95
96
96
newValue = eww->value ();
97
97
98
- if (( oldValue != newValue && newValue.isValid () ) || oldValue.isNull () != newValue.isNull () )
98
+ if ( ( oldValue != newValue && newValue.isValid () ) || oldValue.isNull () != newValue.isNull () )
99
99
{
100
100
vl->beginEditCommand ( tr ( " Attribute changed" ) );
101
101
vl->changeAttributeValue ( fid, fieldIdx, newValue, oldValue );
@@ -105,7 +105,7 @@ void QgsAttributeTableDelegate::setModelData( QWidget *editor, QAbstractItemMode
105
105
106
106
void QgsAttributeTableDelegate::setEditorData ( QWidget *editor, const QModelIndex &index ) const
107
107
{
108
- QgsEditorWidgetWrapper* eww = QgsEditorWidgetWrapper::fromWidget ( editor );
108
+ QgsEditorWidgetWrapper * eww = QgsEditorWidgetWrapper::fromWidget ( editor );
109
109
if ( !eww )
110
110
return ;
111
111
@@ -117,7 +117,7 @@ void QgsAttributeTableDelegate::setFeatureSelectionModel( QgsFeatureSelectionMod
117
117
mFeatureSelectionModel = featureSelectionModel;
118
118
}
119
119
120
- void QgsAttributeTableDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
120
+ void QgsAttributeTableDelegate::paint ( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const
121
121
{
122
122
QgsAttributeTableFilterModel::ColumnType columnType = static_cast <QgsAttributeTableFilterModel::ColumnType>( index.model ()->data ( index, QgsAttributeTableFilterModel::TypeRole ).toInt () );
123
123
0 commit comments