Customizable Print Formats GSoC 2015

Gehad Elrobey gehadelrobey at gmail.com
Thu Mar 5 15:52:03 PST 2015


On Thu, Mar 5, 2015 at 6:55 PM, Lubomir I. Ivanov <neolit123 at gmail.com>
wrote:

> On 4 March 2015 at 16:31, Tomaz Canabrava <tcanabrava at kde.org> wrote:
> >
> >
> > On Wed, Mar 4, 2015 at 11:14 AM, Lubomir I. Ivanov <neolit123 at gmail.com>
> > wrote:
> >>
> >> On 4 March 2015 at 16:05, Tomaz Canabrava <tcanabrava at kde.org> wrote:
> >> >>
> >> >> also, i don't understand Tomaz' idea about the Grantlee extension, so
> >> >> perhaps we need to investigate into that as well.
> >> >> it probably uses QTableView Qt's Model-View-X pattern, which i don't
> >> >> like that much, yet Subsurface already uses it pretty much
> everywhere!
> >> >
> >> >
> >> >
> >> > Grantlee *is* a HTML + CSS template engine that integrates with Qt.
> >> > it follows Django template scheme, so it's very flexible and easy to
> >> > extend
> >> >
> >>
> >> yep, i did gather that previously.
> >>
> >> > for instance, we could do something like this in grantlee:
> >> >
> >> > template.html
> >> >
> >> > <header> ... </header>
> >> > <body>
> >> >    < h1 > {{ dive.where }} </h1>
> >> >    < h2 > {{ dive.buddy }} </h2>
> >> > </body>
> >> >
> >> > ( yes, very short example )
> >> >
> >> > and let the grantlee template system do it's magic.
> >> >
> >>
> >> i don't understand what the output of Grantlee template generator is;
> >> is it a data model for a QTableView that then can be rendered to an
> >> image, is it an image, or something else?
> >
> >
> > an html file. nothing more than this.
> >
>
> so for the built-in printing, i assume we need to load the file (/text
> ?) into a rendering entity like QTextDocument or QWebPage and then
> produce a QPicture / QPixmap that can be fed to QPrinter?
> do you think that QTextDocument will suffice or WebKit will be needed?
> from what i tested at some point the built-in HTML subset wasn't
> optimal for more complicated input.
>
> lubomir
> --
>

I managed to print a QTextDocument directly after generating the HTML code
by Grantlee with Qt5.
I attached a pdf of the print out.


-- 
regards,
Gehad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150306/89478f2b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: print.pdf
Type: application/pdf
Size: 14309 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150306/89478f2b/attachment-0001.pdf>


More information about the subsurface mailing list