Skip to content

Commit bb1639c

Browse files
committed
Merge pull request #1048 from ahuarte47/Issue_9094-revival
#9094-R: Use ',' and '.' keys similar to '<' and '>' keys in QgsMapToolNodeTool
2 parents 9ef3f86 + 373adbd commit bb1639c

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

src/app/nodetool/qgsmaptoolnodetool.cpp

+18-8
Original file line numberDiff line numberDiff line change
@@ -733,15 +733,25 @@ void QgsMapToolNodeTool::keyPressEvent( QKeyEvent* e )
733733
e->ignore();
734734
}
735735
else
736-
if ( mSelectedFeature && ( e->key() == Qt::Key_Less || e->key() == Qt::Key_Greater ) )
737-
{
738-
int firstSelectedIndex = firstSelectedVertex();
739-
if ( firstSelectedIndex == -1 ) return;
736+
if ( mSelectedFeature && ( e->key() == Qt::Key_Less || e->key() == Qt::Key_Comma ) )
737+
{
738+
int firstSelectedIndex = firstSelectedVertex();
739+
if ( firstSelectedIndex == -1) return;
740740

741-
mSelectedFeature->deselectAllVertexes();
742-
safeSelectVertex( firstSelectedIndex + (( e->key() == Qt::Key_Less ) ? -1 : + 1 ) );
743-
mCanvas->refresh();
744-
}
741+
mSelectedFeature->deselectAllVertexes();
742+
safeSelectVertex( firstSelectedIndex - 1 );
743+
mCanvas->refresh();
744+
}
745+
else
746+
if ( mSelectedFeature && ( e->key() == Qt::Key_Greater || e->key() == Qt::Key_Period ) )
747+
{
748+
int firstSelectedIndex = firstSelectedVertex();
749+
if ( firstSelectedIndex == -1) return;
750+
751+
mSelectedFeature->deselectAllVertexes();
752+
safeSelectVertex( firstSelectedIndex + 1 );
753+
mCanvas->refresh();
754+
}
745755
}
746756

747757
void QgsMapToolNodeTool::keyReleaseEvent( QKeyEvent* e )

0 commit comments

Comments
 (0)