Found the reason for #103713

Michael Brade brade at kde.org
Sun May 15 17:37:08 BST 2005


Hi,

4 weeks ago I posted a question of how to debug this report, but despite all 
your great tips I gave up --- even backtraces didn't help me. Today I had an 
idea, and tried again successfully. The KToolBarButton class is the culprit!

In KToolBarButton::mouseReleaseEvent the buttonClicked is emitted, which calls 
the correct slot in KNotes. However, it also calls 
QToolButton::mouseReleaseEvent, which in turn emits clicked(). Now 
KToolBarButton connects this signal so KToolBarButton::slotClicked() and in 
this slot it emits buttonClicked _again_, but only if the button's 
parent->rect() contains the button itself!

First of all, I don't understand why this has to be so. Any ideas? The comment 
says something about an extension popup menu. What's that? Here's the code:

  // emit buttonClicked when the button was clicked while being in an 
extension popupmenu
  if ( d->m_parent && !d->m_parent->rect().contains( geometry() ) ) {
    ButtonState state = KApplication::keyboardMouseState();
    if ( ( state & MouseButtonMask ) == NoButton )
      state = ButtonState( LeftButton | state );
    emit buttonClicked( d->m_id, state );

Second, this is the reason KNotes works for me but not for others: with 
Keramik the buttons are 10x10 pixels, the toolbar has hight 16. However, with 
Plastik the buttons are bigger than the toolbar although I call 
setIconSize( 10 ). Thus the check in KToolBarButton::slotClicked() fails and 
buttonClicked is emitted again.

Well, that's as far as I got. Is the code in KToolBarButton correct and I 
somehow have to fix the iconsizes in KNotes, or can we fix KToolBarButton as 
well?

Cheers,
-- 
Michael Brade;                 KDE Developer, Student of Computer Science
  |-mail: echo brade !#|tr -d "c oh"|s\e\d 's/e/\@/2;s/$/.org/;s/bra/k/2'
  °--web: http://www.kde.org/people/michaelb.html

KDE 3: The Next Generation in Desktop Experience
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050515/88e262cc/attachment.sig>


More information about the kde-core-devel mailing list