Fwd: debuggind keypress event handling in the plasmoid

Sebastian Kügler sebas at kde.org
Tue Mar 25 15:50:49 UTC 2014


On Tuesday, March 25, 2014 15:17:37 Myriam Schweingruber wrote:
> I presume since this is about Plasma it should go to the Plasma-devel
> mailinglist...

It's not a Plasma question perse, so kde-devel is quite fine.

> A fork? What fork?
> 
> ---------- Forwarded message ----------
> From: Marek Kochanowicz <sirherrbatka at gmail.com>
> Date: Tue, Mar 25, 2014 at 2:31 PM
> Subject: debuggind keypress event handling in the plasmoid
> To: kde-devel at kde.org
> 
> 
> hi,
> 
> I'm working on the fork of the plasma menubar. It will have two additional
> features:
> 1)menu will pop up under the mouse cursor
> 2)there will be a search area to quickly find seeked entry.
> 
> currently it looks like this: http://wstaw.org/m/2014/03/25/zrzut102.png
> 
> entry field works but it is not quite functional yet. What bothers me right
> now, are segfaults triggered with any none alpha numeric key (for instance
> print-screen but also alt-gr).
> 
> http://wklej.org/id/1311595
> 
> i'm not sure what is wrong here. Should i not pass all keys to the klineedit
> (mFilterWidget)? Can anybody give me a tip? Debugging is hard :(

I've done something similar, albeit in QML not long ago. What worked best for 
me is to give focus to the line edit as soon as someone begins typing anything 
not-relevant to the input, and handle it from there. The rationale is that the 
lineedit is way more complex in terms of input than the menu. The few keys 
that you need for menu navigation can easily be caught from your lineedit, but 
they complex interaction of a lineedit is hard, and thus error-prone to 
replicate in the way you try to.

Hope it helps ...
-- 
sebas

http://www.kde.org | http://vizZzion.org | GPG Key ID: 9119 0EF9


More information about the Plasma-devel mailing list