Commit f8b9f617 authored by Erik Verbruggen's avatar Erik Verbruggen

Editors: do not hide mouse when only a modifier is pressed.

So when doing ctrl-/cmd-click mouse navigation, this will prevent the
mouse cursor from disappearing.

Change-Id: I147332c47a8946ce69ddd719ac73b6132d5816db
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
Reviewed-by: default avatarDavid Schulz <david.schulz@digia.com>
parent 687a5469
......@@ -1576,10 +1576,25 @@ bool BaseTextEditorWidget::cursorMoveKeyEvent(QKeyEvent *e)
return true;
}
static inline bool isModifier(QKeyEvent *e)
{
if (!e)
return false;
switch (e->key()) {
case Qt::Key_Shift:
case Qt::Key_Control:
case Qt::Key_Meta:
case Qt::Key_Alt:
return true;
default:
return false;
}
}
void BaseTextEditorWidget::keyPressEvent(QKeyEvent *e)
{
viewport()->setCursor(Qt::BlankCursor);
if (!isModifier(e))
viewport()->setCursor(Qt::BlankCursor);
ToolTip::instance()->hide();
d->m_moveLineUndoHack = false;
......
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