Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Graphics
KolourPaint
Commits
676899ef
Commit
676899ef
authored
Nov 22, 2020
by
Martin Koller
Browse files
Don't grab/release keyboard to get key events. Use setFocus() instead
BUG: 405991
FIXED-IN: 20.12 (cherry picked from commit
35c55d4a
)
parent
bb12569a
Changes
1
Hide whitespace changes
Inline
Side-by-side
kpViewScrollableContainer.cpp
View file @
676899ef
...
...
@@ -197,7 +197,6 @@ void kpGrip::cancel ()
setCursor
(
Qt
::
ArrowCursor
);
m_shouldReleaseMouseButtons
=
true
;
releaseKeyboard
();
emit
cancelledDraw
();
}
...
...
@@ -224,7 +223,7 @@ void kpGrip::mousePressEvent (QMouseEvent *e)
m_startPoint
=
e
->
pos
();
m_currentPoint
=
e
->
pos
();
emit
beganDraw
();
grabKeyboard
();
setFocus
();
// allow to receive keyboard events to be able to handle ESC
setUserMessage
(
i18n
(
"Resize Image: Right click to cancel."
));
setCursor
(
cursorForType
(
m_type
));
...
...
@@ -310,7 +309,6 @@ void kpGrip::mouseReleaseEvent (QMouseEvent *e)
m_currentPoint
=
KP_INVALID_POINT
;
m_startPoint
=
KP_INVALID_POINT
;
releaseKeyboard
();
emit
endedDraw
((
m_type
&
kpGrip
::
Right
)
?
dx
:
0
,
(
m_type
&
kpGrip
::
Bottom
)
?
dy
:
0
);
}
...
...
@@ -321,7 +319,6 @@ void kpGrip::mouseReleaseEvent (QMouseEvent *e)
setUserMessage
(
QString
());
setCursor
(
cursorForType
(
m_type
));
releaseKeyboard
();
emit
releasedAllButtons
();
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment