From 6f66745ce3a66825002454cd1116bbfebe29445c Mon Sep 17 00:00:00 2001 From: zi-mozhuang <2802443161@qq.com> Date: Wed, 12 Aug 2026 15:07:52 +0800 Subject: [PATCH 1/4] Apply minimal title block fix to zh (from c77f78e4a) --- sources/bordertitleblock.h | 3 +++ sources/print/projectprintwindow.cpp | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sources/bordertitleblock.h b/sources/bordertitleblock.h index d13abad09..4a1b60a09 100644 --- a/sources/bordertitleblock.h +++ b/sources/bordertitleblock.h @@ -94,6 +94,9 @@ class BorderTitleBlock : public QObject QRectF titleBlockRect () const; + // @return the edge where title block is docked + Qt::Edge titleBlockEdge() const { return(m_edge); } + DiagramContext titleblockInformation() const; private: QRectF titleBlockRectForQPainter () const; diff --git a/sources/print/projectprintwindow.cpp b/sources/print/projectprintwindow.cpp index b115ad5b7..5d369b485 100644 --- a/sources/print/projectprintwindow.cpp +++ b/sources/print/projectprintwindow.cpp @@ -450,9 +450,13 @@ QRect ProjectPrintWindow::diagramRect(Diagram *diagram, const ExportProperties & { auto diagram_rect = diagram->border_and_titleblock.borderAndTitleBlockRect(); if (!option.draw_titleblock) { - auto titleblock_height = diagram->border_and_titleblock.titleBlockRect().height(); - diagram_rect.setHeight(diagram_rect.height() - titleblock_height); - } + auto tbt_rect = diagram->border_and_titleblock.titleBlockRect(); + if (diagram->border_and_titleblock.titleBlockEdge() == Qt::BottomEdge) + diagram_rect.setHeight(diagram_rect.height() - tbt_rect.height()); + else + diagram_rect.setWidth(diagram_rect.width() - tbt_rect.width()); + } + //Adjust the border of diagram to 1px (width of the line) diagram_rect.adjust(0,0,1,1); From 1684d2cfe643ae8bf64368218ee74c6f3927a097 Mon Sep 17 00:00:00 2001 From: zi-mozhuang <2802443161@qq.com> Date: Wed, 12 Aug 2026 15:13:52 +0800 Subject: [PATCH 2/4] syn --- sources/bordertitleblock.h | 5 ++--- sources/print/projectprintwindow.cpp | 11 +++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/sources/bordertitleblock.h b/sources/bordertitleblock.h index 4a1b60a09..bc57748e2 100644 --- a/sources/bordertitleblock.h +++ b/sources/bordertitleblock.h @@ -73,6 +73,8 @@ class BorderTitleBlock : public QObject return(rows_count_ * rows_height_); } /// @return la rows header width, in pixels qreal rowsHeaderWidth() const { return(rows_header_width_); } + // @return the edge where title block is docked + Qt::Edge titleBlockEdge() const { return(m_edge); } // border - title block = diagram /** @@ -94,9 +96,6 @@ class BorderTitleBlock : public QObject QRectF titleBlockRect () const; - // @return the edge where title block is docked - Qt::Edge titleBlockEdge() const { return(m_edge); } - DiagramContext titleblockInformation() const; private: QRectF titleBlockRectForQPainter () const; diff --git a/sources/print/projectprintwindow.cpp b/sources/print/projectprintwindow.cpp index 5d369b485..9282b8afa 100644 --- a/sources/print/projectprintwindow.cpp +++ b/sources/print/projectprintwindow.cpp @@ -450,14 +450,13 @@ QRect ProjectPrintWindow::diagramRect(Diagram *diagram, const ExportProperties & { auto diagram_rect = diagram->border_and_titleblock.borderAndTitleBlockRect(); if (!option.draw_titleblock) { - auto tbt_rect = diagram->border_and_titleblock.titleBlockRect(); - if (diagram->border_and_titleblock.titleBlockEdge() == Qt::BottomEdge) - diagram_rect.setHeight(diagram_rect.height() - tbt_rect.height()); - else - diagram_rect.setWidth(diagram_rect.width() - tbt_rect.width()); + auto tbt_rect = diagram->border_and_titleblock.titleBlockRect(); + if (diagram->border_and_titleblock.titleBlockEdge() == Qt::BottomEdge) + diagram_rect.setHeight(diagram_rect.height() - tbt_rect.height()); + else + diagram_rect.setWidth(diagram_rect.width() - tbt_rect.width()); } - //Adjust the border of diagram to 1px (width of the line) diagram_rect.adjust(0,0,1,1); From e32e5595c02b92bf4ad2cc2f11b33a248dcf0e06 Mon Sep 17 00:00:00 2001 From: zi-mozhuang <2802443161@qq.com> Date: Wed, 12 Aug 2026 15:20:03 +0800 Subject: [PATCH 3/4] syn --- sources/print/projectprintwindow.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sources/print/projectprintwindow.cpp b/sources/print/projectprintwindow.cpp index 9282b8afa..4501ddbac 100644 --- a/sources/print/projectprintwindow.cpp +++ b/sources/print/projectprintwindow.cpp @@ -450,12 +450,12 @@ QRect ProjectPrintWindow::diagramRect(Diagram *diagram, const ExportProperties & { auto diagram_rect = diagram->border_and_titleblock.borderAndTitleBlockRect(); if (!option.draw_titleblock) { - auto tbt_rect = diagram->border_and_titleblock.titleBlockRect(); - if (diagram->border_and_titleblock.titleBlockEdge() == Qt::BottomEdge) - diagram_rect.setHeight(diagram_rect.height() - tbt_rect.height()); - else - diagram_rect.setWidth(diagram_rect.width() - tbt_rect.width()); - } + auto titleblock_rect = diagram->border_and_titleblock.titleBlockRect(); + if (diagram->border_and_titleblock.titleBlockEdge() == Qt::BottomEdge) + diagram_rect.setHeight(diagram_rect.height() - titleblock_rect.height()); + else + diagram_rect.setWidth(diagram_rect.width() - titleblock_rect.width()); + } //Adjust the border of diagram to 1px (width of the line) diagram_rect.adjust(0,0,1,1); From b0172f4dd73ad45b78f400a5138390c433bd013f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=90=E5=A2=A8=E5=BA=84?= <84116885+zi-mozhuang@users.noreply.github.com> Date: Thu, 13 Aug 2026 08:50:24 +0800 Subject: [PATCH 4/4] Change comment style for title block edge method Updated comment to use Doxygen style for documentation. --- sources/bordertitleblock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/bordertitleblock.h b/sources/bordertitleblock.h index bc57748e2..28da7360c 100644 --- a/sources/bordertitleblock.h +++ b/sources/bordertitleblock.h @@ -73,7 +73,7 @@ class BorderTitleBlock : public QObject return(rows_count_ * rows_height_); } /// @return la rows header width, in pixels qreal rowsHeaderWidth() const { return(rows_header_width_); } - // @return the edge where title block is docked + /// @return the edge where title block is docked Qt::Edge titleBlockEdge() const { return(m_edge); } // border - title block = diagram