Skip to content
Permalink
Browse files

[layouts] Tab should always move to next cell, even when editing cont…

…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 066965c707ebd9dcdf16f091092970f0e09390a4
Showing with 16 additions and 0 deletions.
  1. +16 −0 src/gui/tableeditor/qgstableeditorwidget.cpp
@@ -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 );
}

0 comments on commit 066965c

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