Commit bed2c39b authored by Kai Koehne's avatar Kai Koehne

Fix keyboard selection shortcuts on Qml/JS Console

Change-Id: I804df07c711de62c6c8e34810aa17a7ed86f2011
Task-number: QTCREATORBUG-12956
Reviewed-by: default avatarAurindam Jana <aurindam.jana@digia.com>
Reviewed-by: default avatarUlf Hermann <ulf.hermann@digia.com>
parent caa56ea0
......@@ -102,7 +102,9 @@ void QmlConsoleEdit::keyPressEvent(QKeyEvent *e)
case Qt::Key_Home: {
QTextCursor c(textCursor());
c.setPosition(m_startOfEditableArea);
bool select = e->modifiers() & Qt::ShiftModifier;
c.setPosition(m_startOfEditableArea,
select ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor);
setTextCursor(c);
keyConsumed = true;
break;
......@@ -124,7 +126,9 @@ void QmlConsoleEdit::keyPressEvent(QKeyEvent *e)
if (textCursor().position() <= m_startOfEditableArea
|| e->modifiers() & Qt::ControlModifier) {
QTextCursor c(textCursor());
c.setPosition(m_startOfEditableArea);
bool select = e->modifiers() & Qt::ShiftModifier;
c.setPosition(m_startOfEditableArea,
select ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor);
setTextCursor(c);
keyConsumed = true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment