Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixes for actions in attribute table
 * Initialize datastructure in vector layer configuration dialog
 * Fix hidden widget if shown in last column
  • Loading branch information
m-kuhn committed May 3, 2016
1 parent c1687ab commit 8712089
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/app/qgsvectorlayerproperties.cpp
Expand Up @@ -559,6 +559,7 @@ void QgsVectorLayerProperties::apply()
mLayer->actions()->addAction( action );
}
QgsAttributeTableConfig attributeTableConfig = mLayer->attributeTableConfig();
attributeTableConfig.update( mLayer->fields() );
attributeTableConfig.setActionWidgetStyle( mActionDialog->attributeTableWidgetStyle() );
QVector<QgsAttributeTableConfig::ColumnConfig> columns = attributeTableConfig.columns();

Expand Down
13 changes: 13 additions & 0 deletions src/gui/attributetable/qgsattributetablefiltermodel.cpp
Expand Up @@ -478,3 +478,16 @@ Qt::ItemFlags QgsAttributeTableFilterModel::flags( const QModelIndex& index ) co
QModelIndex source_index = mapToSource( index );
return masterModel()->flags( source_index );
}

QModelIndex QgsAttributeTableFilterModel::index( int row, int column, const QModelIndex& parent ) const
{
if ( column > -1 && mColumnMapping.at( column ) == -1 )
{
QModelIndex index = QSortFilterProxyModel::index( row, 0, parent );
return createIndex( row, column, index.internalPointer() );
}
else
{
return QSortFilterProxyModel::index( row, 0, parent );
}
}
4 changes: 3 additions & 1 deletion src/gui/attributetable/qgsattributetablefiltermodel.h
Expand Up @@ -167,7 +167,9 @@ class GUI_EXPORT QgsAttributeTableFilterModel: public QSortFilterProxyModel, pub

virtual QModelIndex mapFromSource( const QModelIndex& sourceIndex ) const override;

Qt::ItemFlags flags( const QModelIndex &index ) const override;
virtual Qt::ItemFlags flags( const QModelIndex &index ) const override;

virtual QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const override;

/**
* Sort by the given column using the given order.
Expand Down

0 comments on commit 8712089

Please sign in to comment.