How to reduce row height in table print

Tomaz Canabrava tcanabrava at kde.org
Thu Mar 19 09:12:32 PDT 2015


On Thu, Mar 19, 2015 at 10:07 AM, Lubomir I. Ivanov <neolit123 at gmail.com>
wrote:

> On 19 March 2015 at 01:28, Lutz Vieweg <lvml at 5t9.de> wrote:
> > Hi,
> >
> > I would like to print more dives per page in "table" mode,
> > just reducing the number sr=4 in
> >>
> >>         const int sr = 12; // smallest row height in pixels
> >>         profilePrintRowHeights.append(sr);
> >
>
> that's for the table in profile print.
>
> > does not help, even if also reducing the model.setFontsize().
> >
> > Is there some easy way to tell subsurface to not put that much
> > margin above/below the table row texts?
> >
>
> that's a good question and i quickly experimented with some code to
> try to answer it.
> nothing works for me: CSS, Qt::SizeHintRole, explicit row heights, etc.
> thus, i don't have an answer ATM, so please wait for the print layout
> rework which is coming in the next few months.
>
> in the meantime if someone has a better idea why QTableView is so
> stubborn, you can give this a try.
>

you need to create a new QStyledItemDelegate with a different width and
pass it to QTableView
it's not hard to do, there are lots of different delegates written for
subsurface.
the easier to change is the StarDelegate - just remove the paint method and
add the sizeHint methods.


>
> lubomir
> --
> _______________________________________________
> subsurface mailing list
> subsurface at subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150319/fc5421b9/attachment.html>


More information about the subsurface mailing list