forked from qt-creator/qt-creator
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: Eike Ziller <eike.ziller@digia.com> Reviewed-by: David Schulz <david.schulz@digia.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user