Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
dualview: autoselect first item
  • Loading branch information
m-kuhn committed Nov 21, 2014
1 parent 6e334d6 commit 1f47ffe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gui/attributetable/qgsdualview.cpp
Expand Up @@ -84,6 +84,8 @@ void QgsDualView::init( QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, const Qg
mFeatureList->setDisplayExpression( mDisplayExpression );
else
columnBoxInit();

mFeatureList->setEditSelection( QgsFeatureIds() << mFeatureListModel->idxToFid( mFeatureListModel->index( 0, 0 ) ) );
}

void QgsDualView::columnBoxInit()
Expand Down Expand Up @@ -119,7 +121,7 @@ void QgsDualView::columnBoxInit()
// ... If there are primary key(s) defined
QStringList pkFields;

Q_FOREACH ( int attr, pkAttrs )
Q_FOREACH( int attr, pkAttrs )
{
pkFields.append( "COALESCE(\"" + fields[attr].name() + "\", '<NULL>')" );
}
Expand Down Expand Up @@ -150,7 +152,7 @@ void QgsDualView::columnBoxInit()
mFeatureListPreviewButton->addAction( mActionExpressionPreview );
mFeatureListPreviewButton->addAction( mActionPreviewColumnsMenu );

Q_FOREACH ( const QgsField& field, fields )
Q_FOREACH( const QgsField& field, fields )
{
if ( mLayerCache->layer()->editorWidgetV2( mLayerCache->layer()->fieldNameIndex( field.name() ) ) != "Hidden" )
{
Expand Down

0 comments on commit 1f47ffe

Please sign in to comment.