From aefae7b73b3ec40ab3ab4bec0c9f61a347e3d6c7 Mon Sep 17 00:00:00 2001 From: joshua Date: Sat, 16 Oct 2021 10:15:45 +0200 Subject: [PATCH] Fix some misprint When print on printer with low resolution, some lines are not printed because to thin. Thin line of elements : set width to 0.5 instead of 0 and set cosmetic option to false. Folio border and titleblock : set width to 1 and set cosmetic option to false. --- sources/bordertitleblock.cpp | 1 - sources/factory/elementpicturefactory.cpp | 2 +- sources/titleblocktemplate.cpp | 3 +-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sources/bordertitleblock.cpp b/sources/bordertitleblock.cpp index 1a476b760..18baf9f6a 100644 --- a/sources/bordertitleblock.cpp +++ b/sources/bordertitleblock.cpp @@ -518,7 +518,6 @@ void BorderTitleBlock::draw(QPainter *painter) //Set the QPainter painter -> save(); QPen pen(Qt::black); - pen.setCosmetic(true); painter -> setPen(pen); painter -> setBrush(Qt::NoBrush); diff --git a/sources/factory/elementpicturefactory.cpp b/sources/factory/elementpicturefactory.cpp index cfda79418..122eda456 100644 --- a/sources/factory/elementpicturefactory.cpp +++ b/sources/factory/elementpicturefactory.cpp @@ -598,7 +598,7 @@ void ElementPictureFactory::setPainterStyle(const QDomElement &dom, QPainter &pa else if (style_value == "normal") pen.setStyle(Qt::SolidLine); } else if (style_name == "line-weight") { if (style_value == "none") pen.setColor(QColor(0, 0, 0, 0)); - else if (style_value == "thin") pen.setWidth(0); + else if (style_value == "thin") pen.setWidthF(0.5); else if (style_value == "normal") pen.setWidthF(1.0); else if (style_value == "hight") pen.setWidthF(2.0); else if (style_value == "eleve") pen.setWidthF(5.0); diff --git a/sources/titleblocktemplate.cpp b/sources/titleblocktemplate.cpp index bf4e21ae7..b66b8eb63 100644 --- a/sources/titleblocktemplate.cpp +++ b/sources/titleblocktemplate.cpp @@ -1515,7 +1515,6 @@ void TitleBlockTemplate::render(QPainter &painter, painter.save(); //Setup the QPainter QPen pen(Qt::black); - pen.setCosmetic(true); painter.setPen(pen); // draw the titleblock border @@ -1661,7 +1660,7 @@ void TitleBlockTemplate::renderCell(QPainter &painter, const QRect &cell_rect) const { // draw the border rect of the current cell - QPen pen(QBrush(), 0.0, Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin); + QPen pen(QBrush(), 1, Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin); pen.setColor(Qt::black); painter.setPen(pen); painter.drawRect(cell_rect);