Skip to content

Commit 1f47ffe

Browse files
committedNov 21, 2014
dualview: autoselect first item
1 parent 6e334d6 commit 1f47ffe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/gui/attributetable/qgsdualview.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ void QgsDualView::init( QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, const Qg
8484
mFeatureList->setDisplayExpression( mDisplayExpression );
8585
else
8686
columnBoxInit();
87+
88+
mFeatureList->setEditSelection( QgsFeatureIds() << mFeatureListModel->idxToFid( mFeatureListModel->index( 0, 0 ) ) );
8789
}
8890

8991
void QgsDualView::columnBoxInit()
@@ -119,7 +121,7 @@ void QgsDualView::columnBoxInit()
119121
// ... If there are primary key(s) defined
120122
QStringList pkFields;
121123

122-
Q_FOREACH ( int attr, pkAttrs )
124+
Q_FOREACH( int attr, pkAttrs )
123125
{
124126
pkFields.append( "COALESCE(\"" + fields[attr].name() + "\", '<NULL>')" );
125127
}
@@ -150,7 +152,7 @@ void QgsDualView::columnBoxInit()
150152
mFeatureListPreviewButton->addAction( mActionExpressionPreview );
151153
mFeatureListPreviewButton->addAction( mActionPreviewColumnsMenu );
152154

153-
Q_FOREACH ( const QgsField& field, fields )
155+
Q_FOREACH( const QgsField& field, fields )
154156
{
155157
if ( mLayerCache->layer()->editorWidgetV2( mLayerCache->layer()->fieldNameIndex( field.name() ) ) != "Hidden" )
156158
{

0 commit comments

Comments
 (0)
Please sign in to comment.