Skip to content
Permalink
Browse files

add shortcuts to browse feature list

  • Loading branch information
3nids committed May 17, 2019
1 parent 943c7d5 commit 7219835a763da0165d52d315bfd40cf66178025c
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/gui/attributetable/qgsdualview.cpp
@@ -21,6 +21,7 @@
#include <QGroupBox>
#include <QInputDialog>
#include <QTimer>
#include <QShortcut>

#include "qgsapplication.h"
#include "qgsactionmanager.h"
@@ -62,11 +63,21 @@ QgsDualView::QgsDualView( QWidget *parent )
connect( mActionExpressionPreview, &QAction::triggered, this, &QgsDualView::previewExpressionBuilder );
connect( mFeatureListView, &QgsFeatureListView::displayExpressionChanged, this, &QgsDualView::previewExpressionChanged );

// browsing toolbar
connect( mNextFeatureButton, &QToolButton::clicked, mFeatureListView, &QgsFeatureListView::editNextFeature );
connect( mPreviousFeatureButton, &QToolButton::clicked, mFeatureListView, &QgsFeatureListView::editPreviousFeature );
connect( mFirstFeatureButton, &QToolButton::clicked, mFeatureListView, &QgsFeatureListView::editFirstFeature );
connect( mLastFeatureButton, &QToolButton::clicked, mFeatureListView, &QgsFeatureListView::editLastFeature );

QShortcut *prevSC = new QShortcut( QKeySequence( QStringLiteral( "Ctrl+Left" ) ), this );
connect( prevSC, &QShortcut::activated, mFeatureListView, &QgsFeatureListView::editPreviousFeature );
QShortcut *nextSC = new QShortcut( QKeySequence( QStringLiteral( "Ctrl+Right" ) ), this );
connect( nextSC, &QShortcut::activated, mFeatureListView, &QgsFeatureListView::editNextFeature );
QShortcut *firstSC = new QShortcut( QKeySequence( QStringLiteral( "Ctrl+Up" ) ), this );
connect( firstSC, &QShortcut::activated, mFeatureListView, &QgsFeatureListView::editFirstFeature );
QShortcut *lastSC = new QShortcut( QKeySequence( QStringLiteral( "Ctrl+Down" ) ), this );
connect( lastSC, &QShortcut::activated, mFeatureListView, &QgsFeatureListView::editLastFeature );

QButtonGroup *buttonGroup = new QButtonGroup( this );
buttonGroup->setExclusive( false );
buttonGroup->addButton( mFlashButton, FlashFeature );

0 comments on commit 7219835

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