This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Custom InputHandler

Tags: None
(comma "," separated)
ngillotte
Registered Member
Posts
4
Karma
0

Custom InputHandler

Mon Feb 11, 2013 10:23 pm
I'm trying to handle custom inputs on a MarbleWidget, while retaining existing InputHandler functionality. Basically, I want to install an Event Filter on top of the existing functionality, so I can grab "my inputs" and return true, or return false to pass it down the stack. Based on the tutorials I have looked at, there seem to be several ways to do this: subclass MarbleWidgetInputHandler, subclass LayerInterface, or create a plugin. What is the best way to do this?

My first instinct was to subclass MarbleWidgetInputHandler, and reimplement eventFilter, but I have run into several roadblocks which make me wonder if I'm on the wrong path.

First, I subclassed MarbleWidget, but when I did that, I lost all the existing functionality like dragging the globe to move the map; this is because all of the actual functionality is in MarbleWidgetDefaultInputHandler.

Second, I subclassed MarbleWidgetDefaultInputHandler, and got the Marble functionality back; however, I don't think I can reimplement eventFilter anymore, since it is not declared virtual in MarbleWidgetDefaultInputHandler. Am I missing something, or should I try another route?

My C++ is a little rusty, so please forgive me if I'm missing something obvious. Thanks.


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, Sogou [Bot]