diff options
author | Mateusz Piekos <mateuszpiekos@gmail.com> | 2012-06-26 12:23:47 (GMT) |
---|---|---|
committer | Mateusz Piekos <mateuszpiekos@gmail.com> | 2012-06-26 12:23:47 (GMT) |
commit | 60076b8e5dc557716e82d7588ff9a99247e485bf (patch) | |
tree | 9d8cc54bed7036f93098cf60b76288217c1f06e3 /Swift/QtUI/Whiteboard/WhiteboardElementDrawingVisitor.h | |
parent | 99bc38e1d21b0081618485e49b0ab1bcd5bef22f (diff) | |
download | swift-contrib-60076b8e5dc557716e82d7588ff9a99247e485bf.zip swift-contrib-60076b8e5dc557716e82d7588ff9a99247e485bf.tar.bz2 |
Added handling of text elements
Diffstat (limited to 'Swift/QtUI/Whiteboard/WhiteboardElementDrawingVisitor.h')
-rw-r--r-- | Swift/QtUI/Whiteboard/WhiteboardElementDrawingVisitor.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Swift/QtUI/Whiteboard/WhiteboardElementDrawingVisitor.h b/Swift/QtUI/Whiteboard/WhiteboardElementDrawingVisitor.h index 4b2f7ed..214ea10 100644 --- a/Swift/QtUI/Whiteboard/WhiteboardElementDrawingVisitor.h +++ b/Swift/QtUI/Whiteboard/WhiteboardElementDrawingVisitor.h @@ -85,7 +85,14 @@ namespace Swift { } void visit(WhiteboardTextElement& element) { - + QGraphicsTextItem* item = new QGraphicsTextItem(P2QSTRING(element.getText())); + item->setPos(QPointF(element.getX(), element.getY())); + QFont font = item->font(); + font.setPointSize(element.getSize()); + item->setFont(font); + Color color = element.getColor(); + item->setDefaultTextColor(QColor(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha())); + graphicsView_->scene()->addItem(item); } void visit(WhiteboardEllipseElement& element) { |