From cb7cbbf0e138c7b1b924661e06a34ae4e749b057 Mon Sep 17 00:00:00 2001 From: xavier Date: Sun, 27 May 2012 15:18:22 +0000 Subject: [PATCH] Diagram editor: fixed a text position bug that occurred only when dropping elements onto diagrams. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@1866 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/elementtextitem.cpp | 8 ++++++++ sources/elementtextitem.h | 1 + 2 files changed, 9 insertions(+) diff --git a/sources/elementtextitem.cpp b/sources/elementtextitem.cpp index 342b80012..378d343a9 100644 --- a/sources/elementtextitem.cpp +++ b/sources/elementtextitem.cpp @@ -181,6 +181,14 @@ qreal ElementTextItem::originalRotationAngle() const { return(original_rotation_angle_); } +/** + Set the font used to render the text item to \a font. +*/ +void ElementTextItem::setFont(const QFont &font) { + DiagramTextItem::setFont(font); + adjustItemPosition(1); +} + /** Cette methode s'assure que la position de l'ElementTextItem est coherente en ajustant : diff --git a/sources/elementtextitem.h b/sources/elementtextitem.h index 7ffecbf34..fbaa28250 100644 --- a/sources/elementtextitem.h +++ b/sources/elementtextitem.h @@ -65,6 +65,7 @@ class ElementTextItem : public DiagramTextItem { QPointF originalPos() const; void setOriginalRotationAngle(const qreal &); qreal originalRotationAngle() const; + virtual void setFont(const QFont &); public slots: void adjustItemPosition(int = 0);