From 9766b8f01e310d6ec3180dadd67f2ef052d01390 Mon Sep 17 00:00:00 2001 From: blacksun Date: Fri, 28 Mar 2014 10:33:14 +0000 Subject: [PATCH] cross ref item: improve improve the position of the comment at the bottom of the cross git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2950 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/qetgraphicsitem/crossrefitem.cpp | 10 ++++------ sources/qetgraphicsitem/crossrefitem.h | 1 - 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/sources/qetgraphicsitem/crossrefitem.cpp b/sources/qetgraphicsitem/crossrefitem.cpp index 5ac77d9b1..e1d39eada 100644 --- a/sources/qetgraphicsitem/crossrefitem.cpp +++ b/sources/qetgraphicsitem/crossrefitem.cpp @@ -86,8 +86,8 @@ void CrossRefItem::updateLabel() { //draw the cross QRectF br = boundingRect(); - qp.drawLine(br.width()/2, 0, br.width()/2, br.height()-9); //vertical line - qp.drawLine(br.width()/2-25, header, br.width()/2+25, header); //horizontal line + qp.drawLine(br.width()/2, 0, br.width()/2, br.height() - text_rect_.height()); //vertical line + qp.drawLine(br.width()/2-25, header, br.width()/2+25, header); //horizontal line //draw the symbolic NO qreal xoffset = br.width()/2 - 25; @@ -105,9 +105,6 @@ void CrossRefItem::updateLabel() { QPointF(xoffset+5, 3), QPointF(xoffset+10, 3), QPointF(xoffset+10, 0) - /*QPointF(30, 3), - QPointF(35, 3), - QPointF(35, 0),*/ }; qp.drawPolyline(p2,3); QPointF p3[3] = { @@ -248,7 +245,7 @@ void CrossRefItem::setUpBoundingRect(QPainter &painter) { painter.save(); painter.setFont(QETApp::diagramTextsFont(6)); //calcule the size au graphic text - text_rect_ = QRectF(default_bounding.bottomLeft(), QPointF(default_bounding.bottomRight().x(), default_bounding.bottomRight().y()-9)); + text_rect_ = QRectF(default_bounding.bottomLeft(), QPointF(default_bounding.bottomRight().x(), default_bounding.bottomRight().y()-1)); text_rect_ = painter.boundingRect(text_rect_, Qt::AlignHCenter ,comment); bounding_rect_.setSize(default_bounding.united(text_rect_).size()); @@ -262,6 +259,7 @@ void CrossRefItem::setUpBoundingRect(QPainter &painter) { } painter.restore(); } + else text_rect_ = QRectF(); } /** diff --git a/sources/qetgraphicsitem/crossrefitem.h b/sources/qetgraphicsitem/crossrefitem.h index 9e31d99ab..fd86cc1c9 100644 --- a/sources/qetgraphicsitem/crossrefitem.h +++ b/sources/qetgraphicsitem/crossrefitem.h @@ -63,7 +63,6 @@ class CrossRefItem : public QetGraphicsItem QRectF bounding_rect_ , text_rect_; QPicture drawing_; QPainterPath shape_path_; - }; #endif // CROSSREFITEM_H