KPopupMenu (& hence K-Menu) keyboard navigation patch

Hamish Rodda meddie at yoyo.its.monash.edu.au
Sat Apr 27 10:38:59 BST 2002


>Couldn't you make bool noMatches, shortcuts, autoExec; bit fields?
>I mean doing it like bool noMatches:1; .... It seems like common practise to
>do so.

Sure, I just don't have any experience with that, I'll look into it.

>if (!d->shortcuts) {
>+        // continue event processing by Qpopup
>+        e->ignore();
>+        QPopupMenu::keyPressEvent(e);
>+        return;
>+    }
>do we really need to ignore this event and then pass it to QPopupMenu? This
>seems wrong to me or could you explain me the intended behaviour?

The intended behaviour is to allow the parent widget class to deal with the 
event instead. I think I mis-interpreted the Qt docs, will review.

>if (d->keySeq != QString::null) { in keyPressEvent why not make it
>!d->keySeq.isEmpty() ?

Just the way I write it, is there a difference?

>count() in QPopupMenu returns unsigned right? so you declare int i; but
> casts in a for loop unsinged int to int to avoid warnings. So why not use
> unsigned int for i?

I've done that so I can set lastHitIndex to -1, to avoid having another 
variable when doing comparisons for when there is no last hit item. I was 
working with uints but it increased complexity.

Cheers,

Hamish.




More information about the kde-core-devel mailing list