Skip to content
Permalink
Browse files

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 871208922dfca8edbf321caeb376b86f9dd97da0
@@ -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();

@@ -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 );
}
}
@@ -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.

0 comments on commit 8712089

Please sign in to comment.
You can’t perform that action at this time.