profilewidget2: fix line width when printing on OSX and Linux

On OSX and Linux only, the cosmetic width of the QPen
on profile axes does not work and is weirdly dependent on the
fact if a printer is installed or not. Possible Qt bugs at hand.

The same is not present on Win32.

To solve the issues we add setPrintMode() in DiveCartesianAxis
and call it for all instances of the class in ProfileWidget2.

This patch also moves gridPen() as a private member function
of PartialGasPressureAxis as it now needs to access member
variables.

Fixes #943

Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Lubomir I. Ivanov 2015-10-11 14:21:14 +03:00 committed by Dirk Hohndel
parent 11e38710e4
commit d0d83d5d7d
3 changed files with 35 additions and 8 deletions

View file

@ -1479,6 +1479,16 @@ void ProfileWidget2::setPrintMode(bool mode, bool grayscale)
{
printMode = mode;
resetZoom();
// set printMode for axes
profileYAxis->setPrintMode(mode);
gasYAxis->setPrintMode(mode);
temperatureAxis->setPrintMode(mode);
timeAxis->setPrintMode(mode);
cylinderPressureAxis->setPrintMode(mode);
heartBeatAxis->setPrintMode(mode);
percentageAxis->setPrintMode(mode);
isGrayscale = mode ? grayscale : false;
mouseFollowerHorizontal->setVisible(!mode);
mouseFollowerVertical->setVisible(!mode);