Skip to content
Permalink
Browse files

dualview: autoselect first item

  • Loading branch information
m-kuhn committed Nov 21, 2014
1 parent 6e334d6 commit 1f47ffeb69154731931fb99cfaaa97d16ea65c75
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/gui/attributetable/qgsdualview.cpp
@@ -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()
@@ -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>')" );
}
@@ -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" )
{

0 comments on commit 1f47ffe

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