Reply to topic

Can't port a Input Handler because of a missing Presenter

jalvarez
Registered Member
Posts
3
Karma
0
Hello.

I'm upgrading a large piece of software that is using QT 5.4 and Marble 4.13 to both QT 5.9 and latest marble. However the MarbleWidgetDefaultInputHandler class no longer exists (so made my input handler extend MarbleWidgetInputHandler instead) but the constructor of this class now requires a MarbleAbstractPresenter instance that I don't have a clue how to make.

Can't find on the Marble source code a way to instantiate a valid MarbleAbstractPresenter and I'm currently at a loss on how to make it happen.

Old class:
Code: Select all
class ownMarbleHandler : public Marble::MarbleWidgetDefaultInputHandler
{
    Q_OBJECT
public:
    explicit ownMarbleHandler(MyMarbleWidget *);
signals:
    void leftClickOnMapSignal(int x, int y);
    void rightClickOnMapSignal(int _x, int _y);
    void pickedAPoint();

protected:
    bool eventFilter( QObject *, QEvent * );

    /* more stuff ...*/
};


Acquiring `eventFilter(...)` is a core part of the Input Handler.

New class:
Code: Select all
class ownMarbleHandler : public Marble::MarbleWidgetInputHandler
{
    Q_OBJECT
public:
    explicit ownMarbleHandler(MarbleAbstractPresenter *marblePresenter, MyMarbleWidget *);
signals:
    void leftClickOnMapSignal(int x, int y);
    void rightClickOnMapSignal(int _x, int _y);
    void pickedAPoint();

protected:
    bool eventFilter( QObject *, QEvent * );

    /* more stuff ...*/
};

Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], BobF, Google [Bot], MSN [Bot], Zeikcied