[Marble-devel] How does LayerInterface ask for an update?
Kishore Jonnalagadda
kitts.mailinglists at gmail.com
Fri Aug 12 17:57:33 UTC 2011
On Aug 12, 2011 10:50 PM, "Bernhard Beschow" <bbeschow at cs.tu-berlin.de>
wrote:
>
> Hi Kishore,
>
> > I am porintg some old code that user the customPaint method to instead
use
> > LayerInterface. The one part that i am stuck with is how does
LayerInterface
> > inform the widget that its needs update?
> >
> > Previously, with customPaint() as the whole paint and data to be
information
> > to be painted was within the widget, i could simply call update() on the
> > widget. Now that i have modularized the code, and layers are separated
from
> > the widget (they have no pointer to it) i was wondering how this is to
be
> > achieved?
> >
> > Am i misusing the API? I do not want to create a marble plugin and
install it
> > into the marble install directories for it to work properly. Is there a
> > solution?
>
> Yes, there is a solution :) :
>
> You could add a signal to your LayerInterface implementation, e.g.
"requestUpdate()" and call that instead of MarbleWidget::update(). When
adding your layer to MarbleWidget, you connect that signal to
MarbleWidget::update().
Hehe... yes that would work just fine but I was hoping to not have to extend
the interface...
Boring details follow with the reasons for avoiding the solution...
In my application, the map is an optional plugin. By extending the
LayerInterface class with especially a qobject having signals and slots, the
map plugin would have to provide a library that contains the derived class.
Other plugins that want to take advantage of the map would have to now link
with both my-plugin-exported-library and marblewidget itself. Consequently,
in the absence of the my-map-plugin, the other plugin cannot even load!
I'll look for other ways before I go this route. Especially if my map plugin
implementation can 'inject' a render plugin into marble widget.
Cheers!
Kishore
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20110812/4f03d3ae/attachment.html>
More information about the Marble-devel
mailing list