problem with KToggleToolBarAction (+patch)
Simon Hausmann
hausmann at kde.org
Sat Oct 26 11:46:09 BST 2002
On Fri, Oct 25, 2002 at 11:46:17PM +0200, David Faure wrote:
> On Friday 25 October 2002 20:34, Simon Hausmann wrote:
> > 1) We could make setChecked less intelligent. I guess the original idea behind
> > the current setChecked implementation was to make things easier for developers
> > calling setChecked explicitly. To still update the toolbar visibility status
> > when the user activates the corresponding 'Show Foo Toolbar' menu item we could
> > simply call setShown() on the toolbar in slotActivated() . This solution is
> > implemented in kaction2_patch.txt
>
> Yes, it's wrong that setChecked(bool) activates some changes, it should only
> check or uncheck the action. Remember that we removed "emit activated"
> from setChecked in KToggleAction. The hiding/showing of the toolbars should
> only happen when the _user_ activates the action, not when setChecked() is called.
ACK.
> > Solution 1 could possibly break third-party apps that rely on setChecked
> > basically causing the activation on the action (-> showing/hiding the toolbar)
>
> Those would need to be fixed. Did this action exist in 3.0?
Ahh, very good point. It's new in 3.1. Ok to commit
kaction2_patch.txt then?
> PS: Solution 1 is kaction2_patch.txt and solution 2 is kaction1_patch.txt? How confusing ;)
And even worse, I attached them in reverse order ;)
(it's that I hacked kaction1_patch first, then realized the other
approach is better :)
Simon
P.S.: The original problem is fortunately already solved in Qt.
Thanks to Matthias isVisible() now returns false inside hideEvent(),
which now causes the show()/hide() calls not to get executed anymore
in KToggleToolBarAction::setChecked() .
More information about the kde-core-devel
mailing list