Skip to content
Commit bea0ac4e authored by Andreas Xavier's avatar Andreas Xavier
Browse files

Fix crash when exiting unfinished written mode practice with style sheet

The bug was as follows.  When a WrittenPracticeWidget using a KLineEdit
styled with a qStyleSheet that has focus is deleted this triggers a
focus changing event, but the QStyleSheet returns a style that has
already been deleted and causes a crash when the invalid style is
applied.

The obvious solution of responding to the destroyed() event doesn't
work, because the destroyed() event happens after the crash.

In order to fix this bug, I transistion focus away from the KLineEdit
before the focus change preceding deletion.  The virtual function,
WrittenPracticeWidget::objectDestroyed,  avoids having a
practice mode switch statement as large as this comment
at each delete event.

BUG: 332596
REVIEW: 119119
parent 00541027
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