Printing Support - brainstorm.

Lubomir I. Ivanov neolit123 at gmail.com
Mon Jul 22 23:24:19 PDT 2013


On 22 July 2013 23:54, Tomaz Canabrava <tcanabrava at kde.org> wrote:
> On Mon, Jul 22, 2013 at 4:34 PM, Linus Torvalds
> <torvalds at linux-foundation.org> wrote:
>> On Mon, Jul 22, 2013 at 12:14 PM, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
>>>
>>>  total_dives: 378
>>>  tableHeight: 21938 px
>>>  n_pages: 20
>>>  page size: QSize(2279, 3308) px
>>>  printer dpi: 300
>>>  elapsed time: 4300 ms
>>>
>>> apart from the obvious code cleanup, is this acceptable in terms of
>>> performance and can it be improved further?
>>
>> The gtk version wasn't all that speedy either, I think 4-5 seconds for
>> rendering several hundred dives is prefectly fine. Normally you'd only
>> do that once, then maybe print out a few more pages once in a blue
>> moon.
>
> Agree with linux - furthermore , we can always improve the speed later.
> In the Subsurface code, instead of the TModel that I created in your test code,
> you should use the DiveListModel - good thing is that it's alredy
> populated and in use. :)
>

tomaz, i modified the TModel code you've added, a lot (qt-test.zip).
model is blank on initialization, filled only on a print request with
selected dives or all dives and then filled at specific row indexes
with heading rows (beginInsertRows). it maintains an internal list of
items QList<SomeTableModelItem *> instead of using the global
dive_table when data() is called. such items also hold table colors
properties for usage with Qt::BackgroundRole.

i cannot find (grep) the DiveListModel class you mention in the
subsurface tree, but i really think that the table print should
maintain it's own model so that later this can be extended for support
of variadic columns and layouts if even feasable with
QAbstractTableModel...

i suggest a new class TablePrintModel that goes in models.h or do you
have a better suggestion?

lubomir
--


More information about the subsurface mailing list