From da54d17352dfc4070eb6fa105ce853e3d35490ef Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 7 Aug 2014 15:15:38 +0200 Subject: First implementation of images and rectangles Change-Id: Ia905d6dfe3d9922ef820085fedc5195be8ace1da Reviewed-by: Lars Knoll --- softwarecontext/rectanglenode.cpp | 50 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 softwarecontext/rectanglenode.cpp (limited to 'softwarecontext/rectanglenode.cpp') diff --git a/softwarecontext/rectanglenode.cpp b/softwarecontext/rectanglenode.cpp new file mode 100644 index 0000000000..6dde7058c2 --- /dev/null +++ b/softwarecontext/rectanglenode.cpp @@ -0,0 +1,50 @@ +#include "rectanglenode.h" + +RectangleNode::RectangleNode() +{ + setMaterial((QSGMaterial*)1); + setGeometry((QSGGeometry*)1); +} + +void RectangleNode::setRect(const QRectF &rect) +{ + m_rect = rect; +} + +void RectangleNode::setColor(const QColor &color) +{ + m_brush = color; +} + +void RectangleNode::setPenColor(const QColor &color) +{ + m_pen.setColor(color); +} + +void RectangleNode::setPenWidth(qreal width) +{ + m_pen.setWidthF(width); +} + +void RectangleNode::setGradientStops(const QGradientStops &stops) +{ +} + +void RectangleNode::setRadius(qreal radius) +{ +} + +void RectangleNode::setAligned(bool aligned) +{ +} + +void RectangleNode::update() +{ +} + +void RectangleNode::paint(QPainter *painter) +{ + painter->setPen(m_pen); + painter->setBrush(m_brush); + painter->drawRect(m_rect); +} -- cgit v1.2.3