Commit ffac87c4 authored by Marco Bubke's avatar Marco Bubke

QmlDesigner.NodeInstances: Cleanup paint methode

Reviewed-By: Thomas Hartmann
parent f5d0d98a
......@@ -195,23 +195,20 @@ void GraphicsObjectNodeInstance::paintRecursively(QGraphicsItem *graphicsItem, Q
void GraphicsObjectNodeInstance::paint(QPainter *painter) const
{
painter->save();
Q_ASSERT(graphicsObject());
if (hasContent()) {
QStyleOptionGraphicsItem option;
initOption(graphicsObject(), &option, painter->transform());
graphicsObject()->paint(painter, &option);
if (graphicsObject()) {
painter->save();
if (hasContent()) {
QStyleOptionGraphicsItem option;
initOption(graphicsObject(), &option, painter->transform());
graphicsObject()->paint(painter, &option);
}
foreach(QGraphicsItem *graphicsItem, graphicsObject()->childItems()) {
QGraphicsObject *graphicsObject = qgraphicsitem_cast<QGraphicsObject*>(graphicsItem);
if (graphicsObject
&& !nodeInstanceView()->hasInstanceForObject(graphicsObject))
paintRecursively(graphicsItem, painter);
}
}
foreach(QGraphicsItem *graphicsItem, graphicsObject()->childItems())
paintRecursively(graphicsItem, painter);
painter->restore();
painter->restore();
}
}
QPair<QGraphicsObject*, bool> GraphicsObjectNodeInstance::createGraphicsObject(const NodeMetaInfo &metaInfo, QDeclarativeContext *context)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment