forked from qt-creator/qt-creator
QmlDesigner.NodeInstances: Cleanup paint methode
Reviewed-By: Thomas Hartmann
This commit is contained in:
@@ -195,23 +195,20 @@ void GraphicsObjectNodeInstance::paintRecursively(QGraphicsItem *graphicsItem, Q
|
|||||||
|
|
||||||
void GraphicsObjectNodeInstance::paint(QPainter *painter) const
|
void GraphicsObjectNodeInstance::paint(QPainter *painter) const
|
||||||
{
|
{
|
||||||
painter->save();
|
if (graphicsObject()) {
|
||||||
Q_ASSERT(graphicsObject());
|
painter->save();
|
||||||
if (hasContent()) {
|
if (hasContent()) {
|
||||||
QStyleOptionGraphicsItem option;
|
QStyleOptionGraphicsItem option;
|
||||||
initOption(graphicsObject(), &option, painter->transform());
|
initOption(graphicsObject(), &option, painter->transform());
|
||||||
graphicsObject()->paint(painter, &option);
|
graphicsObject()->paint(painter, &option);
|
||||||
|
|
||||||
}
|
}
|
||||||
foreach(QGraphicsItem *graphicsItem, graphicsObject()->childItems()) {
|
|
||||||
QGraphicsObject *graphicsObject = qgraphicsitem_cast<QGraphicsObject*>(graphicsItem);
|
foreach(QGraphicsItem *graphicsItem, graphicsObject()->childItems())
|
||||||
if (graphicsObject
|
|
||||||
&& !nodeInstanceView()->hasInstanceForObject(graphicsObject))
|
|
||||||
paintRecursively(graphicsItem, painter);
|
paintRecursively(graphicsItem, painter);
|
||||||
|
|
||||||
|
painter->restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
painter->restore();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QPair<QGraphicsObject*, bool> GraphicsObjectNodeInstance::createGraphicsObject(const NodeMetaInfo &metaInfo, QDeclarativeContext *context)
|
QPair<QGraphicsObject*, bool> GraphicsObjectNodeInstance::createGraphicsObject(const NodeMetaInfo &metaInfo, QDeclarativeContext *context)
|
||||||
|
|||||||
Reference in New Issue
Block a user