<p>On Aug 12, 2011 10:50 PM, "Bernhard Beschow" <<a href="mailto:bbeschow@cs.tu-berlin.de">bbeschow@cs.tu-berlin.de</a>> wrote:<br>
><br>
> Hi Kishore,<br>
><br>
> > I am porintg some old code that user the customPaint method to instead use<br>
> > LayerInterface. The one part that i am stuck with is how does LayerInterface<br>
> > inform the widget that its needs update?<br>
> ><br>
> > Previously, with customPaint() as the whole paint and data to be information<br>
> > to be painted was within the widget, i could simply call update() on the<br>
> > widget. Now that i have modularized the code, and layers are separated from<br>
> > the widget (they have no pointer to it) i was wondering how this is to be<br>
> > achieved?<br>
> ><br>
> > Am i misusing the API? I do not want to create a marble plugin and install it<br>
> > into the marble install directories for it to work properly. Is there a<br>
> > solution?<br>
><br>
> Yes, there is a solution :) :<br>
><br>
> 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().</p>
<p>Hehe... yes that would work just fine but I was hoping to not have to extend the interface...</p>
<p>Boring details follow with the reasons for avoiding the solution...<br>
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!</p>
<p>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.</p>
<p>Cheers!<br>
Kishore</p>