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
Utilities
Konsole
Commits
914ac120
Commit
914ac120
authored
Oct 10, 2020
by
Martin Tobias Holmedahl Sandsmark
Committed by
Kurt Hindenburg
Oct 10, 2020
Browse files
Fix invalid call on destroyed object
Part of
!209
parent
9d75f9ed
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/CompositeWidgetFocusWatcher.cpp
View file @
914ac120
...
...
@@ -35,10 +35,14 @@ CompositeWidgetFocusWatcher::CompositeWidgetFocusWatcher(QWidget *compositeWidge
bool
CompositeWidgetFocusWatcher
::
eventFilter
(
QObject
*
watched
,
QEvent
*
event
)
{
Q_UNUSED
(
watched
)
auto
*
focusEvent
=
static_cast
<
QFocusEvent
*>
(
event
);
switch
(
event
->
type
())
{
case
QEvent
::
Close
:
case
QEvent
::
DeferredDelete
:
case
QEvent
::
Destroy
:
removeEventFilter
(
watched
);
disconnect
(
this
,
&
CompositeWidgetFocusWatcher
::
compositeFocusChanged
,
watched
,
nullptr
);
break
;
case
QEvent
::
FocusIn
:
emit
compositeFocusChanged
(
true
);
break
;
...
...
src/terminalDisplay/TerminalDisplay.cpp
View file @
914ac120
...
...
@@ -577,7 +577,7 @@ TerminalDisplay::TerminalDisplay(QWidget* parent)
new
AutoScrollHandler
(
this
);
// Keep this last
auto
focusWatcher
=
new
CompositeWidgetFocusWatcher
(
this
,
this
);
CompositeWidgetFocusWatcher
*
focusWatcher
=
new
CompositeWidgetFocusWatcher
(
this
,
this
);
connect
(
focusWatcher
,
&
CompositeWidgetFocusWatcher
::
compositeFocusChanged
,
this
,
[
this
](
bool
focused
)
{
_hasCompositeFocus
=
focused
;});
connect
(
focusWatcher
,
&
CompositeWidgetFocusWatcher
::
compositeFocusChanged
,
...
...
Write
Preview
Markdown
is supported
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