mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
[attrtable] hide "hidden" widgets
This commit is contained in:
parent
0305796ac7
commit
0f0d16af8e
@ -247,15 +247,16 @@ void QgsAttributeTableModel::loadAttributes()
|
||||
|
||||
for ( int idx = 0; idx < fields.count(); ++idx )
|
||||
{
|
||||
QgsEditorWidgetFactory* widgetFactory = QgsEditorWidgetRegistry::instance()->factory( layer()->editorWidgetV2( idx ) );
|
||||
if ( !widgetFactory || !layer() )
|
||||
continue;
|
||||
const QString widgetType = layer()->editorWidgetV2( idx );
|
||||
QgsEditorWidgetFactory* widgetFactory = QgsEditorWidgetRegistry::instance()->factory( widgetType );
|
||||
if ( widgetFactory && widgetType != "Hidden" )
|
||||
{
|
||||
mWidgetFactories.append( widgetFactory );
|
||||
mWidgetConfigs.append( layer()->editorWidgetV2Config( idx ) );
|
||||
mAttributeWidgetCaches.append( widgetFactory->createCache( layer(), idx, mWidgetConfigs.last() ) );
|
||||
|
||||
mWidgetFactories.append( widgetFactory );
|
||||
mWidgetConfigs.append( layer()->editorWidgetV2Config( idx ) );
|
||||
mAttributeWidgetCaches.append( widgetFactory->createCache( layer(), idx, mWidgetConfigs.last() ) );
|
||||
|
||||
attributes << idx;
|
||||
attributes << idx;
|
||||
}
|
||||
}
|
||||
|
||||
if ( mFieldCount < attributes.size() )
|
||||
@ -503,7 +504,7 @@ QVariant QgsAttributeTableModel::data( const QModelIndex &index, int role ) cons
|
||||
|
||||
if ( role == Qt::DisplayRole )
|
||||
{
|
||||
return mWidgetFactories[ fieldId ]->representValue( layer(), fieldId, mWidgetConfigs[ fieldId ], mAttributeWidgetCaches[ fieldId ], val );
|
||||
return mWidgetFactories[ index.column()]->representValue( layer(), fieldId, mWidgetConfigs[ index.column()], mAttributeWidgetCaches[ index.column()], val );
|
||||
}
|
||||
|
||||
return val;
|
||||
|
Loading…
x
Reference in New Issue
Block a user