Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix #1935
git-svn-id: http://svn.osgeo.org/qgis/trunk@11704 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Sep 23, 2009
1 parent b950808 commit 7ecdb1d
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/app/qgsvectorlayerproperties.cpp
Expand Up @@ -183,7 +183,7 @@ void QgsVectorLayerProperties::setRow( int row, int idx, const QgsField &field )
for ( int i = 0; i < 6; i++ )
tblAttributes->item( row, i )->setFlags( tblAttributes->item( row, i )->flags() & ~Qt::ItemIsEditable );

QPushButton * pb = new QPushButton( editTypeButtonText( layer->editType( idx ) ) );
QPushButton *pb = new QPushButton( editTypeButtonText( layer->editType( idx ) ) );
tblAttributes->setCellWidget( row, 6, pb );
connect( pb, SIGNAL( pressed() ), this, SLOT( attributeTypeDialog( ) ) );
mButtonMap.insert( idx, pb );
Expand All @@ -200,15 +200,13 @@ QgsVectorLayerProperties::~QgsVectorLayerProperties()

void QgsVectorLayerProperties::attributeTypeDialog( )
{
int index = -1;
QMap<int, QPushButton*>::iterator it = mButtonMap.begin();
for ( ; it != mButtonMap.end() ; it++ )
{
if ( it.value()->isDown() )
{
index = it.key();
}
}
QPushButton *pb = dynamic_cast<QPushButton *>( sender() );
if ( !pb )
return;

int index = mButtonMap.key( pb, -1 );
if ( index == -1 )
return;

QgsAttributeTypeDialog attributeTypeDialog( layer );

Expand Down Expand Up @@ -243,6 +241,7 @@ void QgsVectorLayerProperties::attributeTypeDialog( )
return;

QgsVectorLayer::EditType editType = attributeTypeDialog.editType();

mEditTypeMap.insert( index, editType );

QString buttonText;
Expand All @@ -258,9 +257,8 @@ void QgsVectorLayerProperties::attributeTypeDialog( )
default:
break;
}
QPushButton *pb = dynamic_cast<QPushButton*>( tblAttributes->cellWidget( index, 6 ) );
pb->setText( editTypeButtonText( editType ) );

pb->setText( editTypeButtonText( editType ) );
}


Expand Down

0 comments on commit 7ecdb1d

Please sign in to comment.