D7828: createKMessageBox tries to focus a default button when available

Emirald Mateli noreply at phabricator.kde.org
Fri Oct 27 19:34:40 UTC 2017


emateli updated this revision to Diff 21453.
emateli added a comment.


  Well, the diff of this patch took a sizeable reduction.
  
  I took a second look at this and here is what happened in the end and what caused the inconsistency with Dolphin.
  
  The issue was that the `QDialogButtonBox` argument, which contains the buttons needs to have a not null parent argument. If it does, then everything works as expected, if it doesn't (which Dolphin does not suppliy) then the focus is all messed up and will be given in order to the widgets created that can be focused.
  
  From what I dug out the order seems to be:
  
  1. Label (if the `AllowLink` flag is present)
  2. The string list
  3. Checkbox
  4. Left most action button
  
  Moving the call of `setParent` before any of the above mentioned widgets is created seems to fix this (I built this system-wide so all the KDE apps running can use it and no issues so far, although it's only been a couple of hours)
  
  If this turns out to be okay, I'll edit the summary and title later, since it is re-purposed in a way by not involving widget focus change.

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D7828?vs=20497&id=21453

REVISION DETAIL
  https://phabricator.kde.org/D7828

AFFECTED FILES
  src/kmessagebox.cpp

To: emateli, #frameworks, ngraham, aacid, #vdg
Cc: rkflx, abetts, subdiff, ngraham, aacid, #frameworks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20171027/e6269a82/attachment.html>


More information about the Kde-frameworks-devel mailing list