<table><tr><td style="">davidhurka 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/D21755">View Revision</a></tr></table><br /><div><div><p>I could imagine to add a parameter ToggleActionMenu::MenuLogic to the constructor.</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="cpp" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);"><span style="color: #aa4000">enum</span> <span class="n">MenuLogic</span> <span class="p">{</span>
    <span class="n">DefaultLogic</span> <span style="color: #aa2211">=</span> <span style="color: #601200">0x0</span><span class="p">,</span>
    <span style="color: #74777d">/**</span>
<span style="color: #74777d">     * Automatically makes the triggered action the default action, even if in a submenu.</span>
<span style="color: #74777d">     * When a toolbar button is constructed, the default action is set to the first checked action in the menu.</span>
<span style="color: #74777d">     * setDefaultAction() provides a fallback if no action is checked.</span>
<span style="color: #74777d">     */</span>
    <span class="n">ImplicitDefaultAction</span> <span style="color: #aa2211">=</span> <span style="color: #601200">0x1</span>
<span class="p">};</span></pre></div>

<p>The integrated QActionGroup (for mutually exclusive actions) requires to subclass ToggleActionMenu, to shadow addAction(). addAction() would need to add the action to the action group.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R223 Okular</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D21755">https://phabricator.kde.org/D21755</a></div></div><br /><div><strong>To: </strong>davidhurka, Okular<br /><strong>Cc: </strong>simgunz, aacid, VDG, okular-devel, fbampaloukas, joaonetto, tfella, ngraham, darcyshen<br /></div>