Menu bar for composer? (was: AW: [Qgis-developer] Python bindings for composer)

Hugentobler Marco marco.hugentobler at karto.baug.ethz.ch
Fri Feb 27 09:31:35 EST 2009


Ok, the bindings are in trunk now.

Btw. what about having a menu bar for the composer main window? I remember there was a discussion about this some time ago but I cannot remember what the arguments against were.

Regards,
Marco 


-----Ursprüngliche Nachricht-----
Von: qgis-developer-bounces at lists.osgeo.org im Auftrag von Hugentobler  Marco
Gesendet: Fr 27.02.2009 08:28
An: Martin Dobias
Cc: qgis-developer at lists.osgeo.org
Betreff: AW: [Qgis-developer] Python bindings for composer
 
>Alternatively you could add a method to QgsComposerView that would
>return pointer to its main window to avoid the need of QPair.
>And maybe I would change the name of the function for qgis interface
>from composerList() to activeComposers() but that's just a matter of
>taste :)

That sounds good. I'm going to add that method to QgsComposerView. 

cheers,
Marco

-----Ursprüngliche Nachricht-----
Von: Martin Dobias [mailto:wonder.sk at gmail.com]
Gesendet: Do 26.02.2009 21:36
An: Hugentobler  Marco
Cc: qgis-developer at lists.osgeo.org
Betreff: Re: [Qgis-developer] Python bindings for composer
 
On Thu, Feb 26, 2009 at 9:04 PM, Hugentobler  Marco
<marco.hugentobler at karto.baug.ethz.ch> wrote:
>>Additionally, I think using a pair of composer window and composer
>>view for the list is a bit redundant... isn't composer view a child of
>>the composer window? If so, plugins could just ask for parent and cast
>>it to QMainWindow. Otherwise I'm affraid we would have to add a
>>wrapper for QList< QPair<T1*, T2*> >. Nothing really hard but better
>>to avoid it.
>
> There are some more objects in between. The parent of QgsComposerView is mViewFrame, the parent of that mSplitter, the parent of that is centralwidget and the parent of that finally is the composer. So it would be possible to call parent()->parent()->parent()->parent() and cast that. But then someone might change the ui elements in designer and all the composer plugins would not work any more.
>
> I already wrote a wrapper for QList< QPair<T1*, T2*> > today for the direction C++ to Python and it seems to work.

Alternatively you could add a method to QgsComposerView that would
return pointer to its main window to avoid the need of QPair.
And maybe I would change the name of the function for qgis interface
from composerList() to activeComposers() but that's just a matter of
taste :)


>>Btw. if you had some time, it would be really great if you could put
>>on wiki some simple examples ("recipes") for composer, e.g.:
>>- load a template and print the map
>>- put some composer items to the composition (and save as a template)
>>Prefferably in Python :-)
>
> Yes, this is an important point (that people unfortunately usually forget to do). Which section is the right place for this? Probably a new page under 'Help on writing plugins' ?

It think the best would be to add a completely new page, something
like Coding Recipes or Developer's Cookbook that would list the
examples, each topic (geometries, vectors, rasters, rendering,
composer, ...) on a separate subpage. Then I would also like to
migrate much of the contents from PythonBindings page there
(PythonBindings has been originally created to record status and
compilation of pyQGIS, however now it contains mostly useful code
snippets).

Martin

_______________________________________________
Qgis-developer mailing list
Qgis-developer at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer





More information about the Qgis-developer mailing list