[Development] QPrintPreview: access to single pages
Giovanni Bajo
rasky at develer.com
Wed Nov 2 02:56:59 CET 2011
Il giorno 01/nov/2011, alle ore 23:36, John Layt ha scritto:
> On Monday 31 Oct 2011 09:37:18 Giovanni Bajo wrote:
>> Hi John,
>>
>> thank you very much for accepting to be the printer maintainer.
>>
>> Last year, we (Develer) proposed a patch that was rejected:
>> http://qt.gitorious.org/qt/qt/merge_requests/733
>>
>> We then opened a bug to discuss an alternative API to implement the features
>> we require: https://bugreports.qt.nokia.com//browse/QTBUG-12168
>>
>> (the two links above summarize our needs quite well)
>>
>> If we could agree on the API at least, we could move on and submit a new
>> patch.
>>
>> Thanks!
>
> Hi Giovanni,
>
> Thanks for bringing this to my notice. I have to confess that QPrintPreview
> is something I haven't touched and so have little knowledge of and it is on my
> learning TODO list. I'll need to get up to speed there before I can comment
> on the proposal properly, but it does feel somewhat awkward to me.
>
> The big hurdle is that we don't really want to make any changes to the
> existing printing code in 5.0 other than the work done to split it into a
> separate module. We want to leave any significant changes for the new module
> in 5.1 or 5.2. That said, if the implementation is a single new method that
> doesn't change much of the existing code and doesn't change the existing api
> or its behaviour then I would consider it.
OK. More to the point, the QPrintPreview::drawPage() method I was thinking of is very simple: it would just draw the specified page's QPicture through the provided painter (so probably a one-liner). Currently, our modified Qt build uses the patch in the merge request (a method to get a copy of the internal QPictures) but since there were concerns with exposing those objects, we would still be set with just being able to draw them.
> The bug report mentions 2 points, 1) to Aquire a separate preview for each
> page and 2) the ability to print page subsets like 1,8,12. I can say now that
> 2) is not supported by Qt currently and will not be supported in QPrintSupport
> in 5.0 as it would require considerable changes to the existing code and api.
> It is a feature that will be in the new printing module though in 5.1/5.2 (in
> fact, it was writing patches to do this that led to my becoming maintainer).
>
> Will fixing 1) still be useful to you without 2)?
Yes, in my case fixing 1 is enough because I can emulate 2 through it (once I get the preview of each page as a "paintable", it's easy to draw the subset of pages your want onto a QPainter and call newPage() inbetween).
Thanks!
--
Giovanni Bajo :: rasky at develer.com
Develer S.r.l. :: http://www.develer.com
My Blog: http://giovanni.bajo.it
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4819 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20111102/f2260c8b/attachment.bin>
More information about the Development
mailing list