Skip to content

Commit

Permalink
[layouts] Tab should always move to next cell, even when editing cont…
Browse files Browse the repository at this point in the history
…ents

Instead use Ctrl+tab as modifier to insert a tab character into cell contents.
(Emulate standard spreadsheet behavior)
  • Loading branch information
nyalldawson committed Jul 27, 2020
1 parent 56dcb43 commit 066965c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/gui/tableeditor/qgstableeditorwidget.cpp
Expand Up @@ -1306,6 +1306,22 @@ void QgsTableEditorTextEdit::keyPressEvent( QKeyEvent *event )
break;
}

case Qt::Key_Tab:
{
if ( event->modifiers() & Qt::ControlModifier )
{
// if tab is pressed then defer to table, unless ctrl modifier is also held
// (emulate spreadsheet behavior)
insertPlainText( QString( '\t' ) );
resizeToContents();
}
else
{
event->ignore();
}
break;
}

default:
QPlainTextEdit::keyPressEvent( event );
}
Expand Down

0 comments on commit 066965c

Please sign in to comment.