<table><tr><td style="">emateli added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D7828" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>Hey <a href="https://phabricator.kde.org/p/subdiff/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;" rel="noreferrer">@subdiff</a>, thanks for your input on this. Whether this patch goes in or not, I still think that this "odd" behaviour is something that the frameworks should fix or change rather than relying on the developer of each application to do this.</p>

<p>However I never expected this to stir up such a conversation given that I thought this was the normal behaviour in Plasma, given that all(?) the other dialogs created by the framework have the default button focused (See: Konsole close dialog w/ multiple tabs open (the exact same dialog as Dolphin's), or Konversation after having joined a channel. )</p>

<p>Since these functions internally all rely on <tt style="background: #ebebeb; font-size: 13px;">createKMessageBox</tt> and work properly so to say, I dug a bit deeper into this and found out the following why Dolphin's close dialog is the odd one out: If no parent window is specified when calling this function then the checkbox will be focused, if one is passed then the focus shifts onto the buttons.</p>

<p>Current call: <tt style="background: #ebebeb; font-size: 13px;">QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Yes | QDialogButtonBox::No | QDialogButtonBox::Cancel);</tt><br />
"Fixed" call: <tt style="background: #ebebeb; font-size: 13px;">QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Yes | QDialogButtonBox::No | QDialogButtonBox::Cancel, dialog);</tt></p>

<p>This leads me to believe that the checkbox having the focus is an irregularity, whether one would consider it a bug is a matter of prespective. But i would expect the frameworks to be consistent in what it does and whether the dialog has a parent or not should not affect what widget is focused.</p>

<p>But just like <a href="https://phabricator.kde.org/p/aacid/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;" rel="noreferrer">@aacid</a> mentioned, we should not look to break existing code, so given the new information on why this occurs, then perhaps a new implementation might be needed or simply a fix for this change in behaviour when a parent widget is present or not.</p></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D7828" rel="noreferrer">https://phabricator.kde.org/D7828</a></div></div><br /><div><strong>To: </strong>emateli, Frameworks, ngraham, aacid, VDG<br /><strong>Cc: </strong>abetts, subdiff, ngraham, aacid, Frameworks<br /></div>