Customizable Print Formats GSoC 2015

Gehad Elrobey gehadelrobey at gmail.com
Fri Mar 20 08:06:47 PDT 2015


On Fri, Mar 20, 2015 at 2:43 AM, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
> On 18 March 2015 at 23:22, Gehad Elrobey <gehadelrobey at gmail.com> wrote:
>> Hello Lubomir,
>>
>> I am attaching a draft of my proposal in pdf format, Please review it.
>> your feedback is most welcome :)
>
> Gehad, your application is very well formed.
> other students can take this into account when they write their own
> applications.
>
> here are some entry level notes and questions that will emphasize on
> eventual topics of interest for the *actual* user base.
>
>> Pre Existing layouts technical information
>> ● Supported Paper size : A4 – A5
>> ● Supported Quality : 300 dpi
>> ● Supported Orientation : Portrait
>
> we need to extract settings from the QPrinterDialog and from the user
> configuration QSettings and adjust the CSS ".media" related sections
> before the pagination.
> i'm pretty sure this is doable.
>

My intention was to extract the settings from the QPrintDialog and
save the user preferences as QSettings, but I think we have to put
some constraints on the resolution (page size and Dpi ) and the page
orientation to produce good quality templates that are able to make
use of the paper area, for sure this constraints can be extended by
writing additional templates, so I think this constraints are on the
templates I am planing to develop in the scope of the project only.

>> Figure(3.1) Printing block diagram
>
> the graph looks good. if can you visualize what i mean by the above
> comment about QPrinterDialog, basically the CSS / HTML will be fed
> (e.g. with search-and-replace amends) with stored settings in the user
> configuration (from QSettings) and also with on-the-spot configuration
> such as margins, orientation etc. from the QPrinterDialog, then
> QPrinter will receive the rendered result as a paint device.
>

Yes, I think Grantlee can take care of that. I will add this to the
block diagram.

>> Rendering the QWebView will take place by scrolling the QPainter viewport over the
>> whole content as shown in Figure(3.2)
>
> hmm, when i experimented with a paginated CSS template there was no
> need to scroll the viewport and QWebView simply, magically paginated
> my pages with render().
> i may be missing something, but if you think that the viewport
> rendering is better i'm glad to hear why?
>

When I use QWebFrame::render() I got the first page only rendered so I
used QWebFrame::scroll() , anyway I didn't test this well I will have
a deeper look into this.

>> Template options
>
> the 3 tabs cover what is required pretty much.
> how do you plan to generate the previews BTW e.g. QWebView rendering
> some sort of default contents on a QPixmap that is placed in the
> dialog?
>

I think the QWebView will render the actual HTML page that will be
printed, so the user can preview the style changes dynamically (I am
not sure how doable is this)

>> Template
>> this will add the ability to change the source code of the template, this will provide very
>> advanced customization and the ability to change where and how does the data
>> appear.
>
> an "update" button will be needed to re-visualize the theme in the preview.
>

"Save" and "Discard" buttons are missing too, I missed those in the
prototyping :)

>> A. Milestones
>> B. Timeline
>
> it's up to you how you are going to plan your work.
>
> here is how i will proceed, but i don't want to change your planned
> workflow much:
> i would start by cleaning absolutely *all* details on the UI part,
> which is usually the most demanding and pretentious part - i.e. there
> are users involved :-).
>
> then, i would sit for a while and think of how i'm going to organize
> all the functionality in terms of code, naming, classes, inter-module
> communication and so on.
> (keep in mind we also have to safely remove the current printer
> related classes).
>
> starting with Grantlee backend seems about right. i would feed it with
> some basic templates, until the QWebView renderer part is done.
> only at that point i would start implementing some of the templates
> and the UI changes.
>

I will edit this part of the proposal as you suggested and resend it again.

-- 
regards,
Gehad


More information about the subsurface mailing list