[Qgis-developer] printing branch ready for testing

Tim Sutton tim at linfiniti.com
Thu Aug 21 01:42:23 EDT 2008


Hi Marco

2008/8/20 Hugentobler  Marco <marco.hugentobler at karto.baug.ethz.ch>:
> Hi Tim,
>
> I think most of the composer classes are reusable for plugins. Is your idea for the new quickprint plugin that it automatically places the items on the composer and user interacts with composer gui or that it directly prints to a pdf or similar format? I think both would be possible with the new composer code:

Yes my idea is that the layout is created programmatically based on a
template (e.g. legend to the left, map to the right, scale underneath)
and the user merely clicks a button and a selects a few options (in
current implemnetation map title and page size). The user would not
interact with QgsComposer at all. I had planned to create a number of
layout templates the user can choose from (for one day in the future).

>
> A plugin could create an instance of QgsComposition (that is a subclass of QGraphicsScene now). Then the plugin adds items programatically to the scene (e.g. QgsComposerMap, QgsComposerScaleBar, ...). Those items are separated from the configuration widgets now, so can be used also by plugins or even non-gui related code.
>
> Then the plugin configures a paint device and a QPainter and calls QGraphicsScene::render to draw the map.
>
> I think that even QgsComposer and QgsComposerView could be moved to gui such that plugins can use the composer gui.
>
> So I suggest to move the following classes to core/composer:
>
> QgsComposition
> QgsComposerMap
> QgsComposerPicture
> QgsComposerLabel
> QgsComposerScaleBar
> QgsComposerLegend
>
> and QgsComposer and QgsComposerView would go to gui.

Right this is exactly what I had in mind with my previous post. In
addition I will try to build some unit tests for the parts that live
in core...

> In the QgisInterface class, there could be a method that returns a pointer to the composer of the current instance such that plugins could add their own buttons/item types.
>
>
> But I must admit that I'm not familiar with the quickprint code and maybe there are some technical problems I didn't consider.


Well I would probably rip out most of it and replace as much as
possible with calls to code in core/composer and or gui/composer. The
key thing for now is to get the non interactive bits into core or gui
(and probably build SIP files for them too so pythonistas can play too
:-).

Best regards

Tim

>
> Regards,
> Marco
>
>
> -----Ursprüngliche Nachricht-----
> Von: Tim Sutton [mailto:tim at linfiniti.com]
> Gesendet: Mi 20.08.2008 23:16
> An: Hugentobler  Marco
> Cc: John C. Tull; qgis-developer at lists.osgeo.org
> Betreff: Re: [Qgis-developer] printing branch ready for testing
>
> Hi Marco
>
> One thing I also wanted to ask - some time ago on this list we
> discussed the mapcomposer overhaul and one of the ideas was to provide
> a separate library component (to go into gui lib) and then a part in
> app that makes use of this and handles user interaction. Is this still
> possible? I would like to update the quickprint plugin to use your new
> composer code but from basic looking through your changes I dont see a
> way to do this without refactoring composer stuff. Failing that I will
> probably try to repair it or remove it or disable it (since it has
> been broken since render context stuff came into trunk I think). I
> think there is still a strong usecase for having something like
> quickprint where users basically press a button and get a print ready
> map, so in an ideal world I'd like to not remove it. Do you have any
> thoughts on the matter?
>
> Best regards
>
> Tim
>
> 2008/8/20 Hugentobler  Marco <marco.hugentobler at karto.baug.ethz.ch>:
>> Hi John,
>>
>> I'm going to give it a try tomorrow on the old G4 in my office.
>>
>>>Is it possible, or planned, to be able to move map items to the
>>>forward or backward? In other words, to be able to arrange map items
>>>to bring them to the front of another item (drawn on top) or to place
>>>them back in the draw queue. I hope that makes sense.
>>
>> Yes, this is one thing that I plan to implement before feature freeze.
>>
>> Regards,
>> Marco
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: John C. Tull im Auftrag von John C. Tull
>> Gesendet: Mi 20.08.2008 19:55
>> An: Hugentobler  Marco
>> Cc: qgis-developer at lists.osgeo.org
>> Betreff: Re: [Qgis-developer] printing branch ready for testing
>>
>> On Aug 16, 2008, at 8:31 AM, Hugentobler Marco wrote:
>>
>>> Hi qgis devs,
>>>
>>> The printcomposer branch is ready for testing now. The branch is
>>> available with svn:
>>>
>>> svn co https://svn.osgeo.org/qgis/branches/advanced_printing_branch
>>>
>>> I'm going to compile windows binaries next week so that it is also
>>> possible to test for non-developers. The plan is to merge the
>>> printing branch to trunk prior to feature freeze for 1.0 (25. August).
>>>
>>> Regards,
>>> Marco
>>
>> Marco,
>>
>> Is it possible, or planned, to be able to move map items to the
>> forward or backward? In other words, to be able to arrange map items
>> to bring them to the front of another item (drawn on top) or to place
>> them back in the draw queue. I hope that makes sense.
>>
>> John
>>
>>
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>
>
>
> --
> Tim Sutton - QGIS Project Steering Committee Member (Release Manager)
> ==============================================
> Visit http://linfiniti.com to find out about:
>  * QGIS programming services
>  * Mapserver and PostGIS based hosting plans
>  * FOSS Consulting Services
> Skype: timlinux Irc: timlinux on #qgis at freenode.net
> ==============================================
>
>
>



-- 
Tim Sutton - QGIS Project Steering Committee Member (Release Manager)
==============================================
Visit http://linfiniti.com to find out about:
 * QGIS programming services
 * Mapserver and PostGIS based hosting plans
 * FOSS Consulting Services
Skype: timlinux Irc: timlinux on #qgis at freenode.net
==============================================


More information about the Qgis-developer mailing list