fix createKMessageBox focus widget inconsistency

Authored by emateli on Nov 3 2017, 1:00 AM.

Description

fix createKMessageBox focus widget inconsistency

Summary:
When creating dialogs via createKMessageBox in case the QDialogButtonBox parameter is parentless, the focus shifts from the left most button to any of the following in this order:

  1. Message Label (if the AllowLink flag is present)
  2. The string list (if it is not empty)
  3. Checkbox confirmation (If present)
  4. Left most action button

Moving the call of setParent of the QDialogButtonBox before any of the above mentioned widgets is created fixes this inconsistency.

Test Plan:
A use case where an application sets a default button but the checkbox is still selected instead is Dolphin.

  1. Open more than 1 tab in Dolphin
  2. Close Dolphin

Expected: The quit button is focused
Actual: Checkbox "Do not ask again" is focused

Reviewers: Frameworks, ngraham, aacid, VDG, rkflx, subdiff

Reviewed By: ngraham, rkflx, subdiff

Subscribers: elvisangelaccio, rkflx, abetts, subdiff, ngraham, aacid, Frameworks

Tags: Frameworks

Differential Revision: https://phabricator.kde.org/D7828

Details

Committed
ngrahamNov 3 2017, 1:02 AM
Reviewer
ngraham
Differential Revision
D7828: fix createKMessageBox focus widget inconsistency
Parents
R236:549b144d96a2: GIT_SILENT Upgrade KF5 version to 5.40.0.
Branches
Unknown
Tags
Unknown