diff --git a/src/tools/qml/qmlobserver/editor/subcomponenteditortool.cpp b/src/tools/qml/qmlobserver/editor/subcomponenteditortool.cpp index 345e2373ef87768a4a3cc94d8908430f27b202ec..f0203fbe6e3302cb0b1f9bb8d5018bd6e5ba6f3c 100644 --- a/src/tools/qml/qmlobserver/editor/subcomponenteditortool.cpp +++ b/src/tools/qml/qmlobserver/editor/subcomponenteditortool.cpp @@ -143,6 +143,12 @@ void SubcomponentEditorTool::setCurrentItem(QGraphicsItem* contextItem) if (!gfxObject) return; + connect(gfxObject, SIGNAL(xChanged()), SLOT(refresh())); + connect(gfxObject, SIGNAL(yChanged()), SLOT(refresh())); + connect(gfxObject, SIGNAL(scaleChanged()), SLOT(refresh())); + connect(gfxObject, SIGNAL(widthChanged()), SLOT(refresh())); + connect(gfxObject, SIGNAL(heightChanged()), SLOT(refresh())); + //QString parentClassName = gfxObject->metaObject()->className(); //if (parentClassName.contains(QRegExp("_QMLTYPE_\\d+"))) @@ -234,6 +240,13 @@ void SubcomponentEditorTool::aboutToPopContext() QGraphicsObject *SubcomponentEditorTool::popContext() { QGraphicsObject *popped = m_currentContext.pop(); + + disconnect(popped, SIGNAL(xChanged()), this, SLOT(refresh())); + disconnect(popped, SIGNAL(yChanged()), this, SLOT(refresh())); + disconnect(popped, SIGNAL(scaleChanged()), this, SLOT(refresh())); + disconnect(popped, SIGNAL(widthChanged()), this, SLOT(refresh())); + disconnect(popped, SIGNAL(heightChanged()), this, SLOT(refresh())); + if (m_currentContext.size() > 1) { m_mask->setCurrentItem(m_currentContext.top()); m_mask->setOpacity(MaxOpacity); @@ -243,6 +256,11 @@ QGraphicsObject *SubcomponentEditorTool::popContext() return popped; } +void SubcomponentEditorTool::refresh() +{ + m_mask->setCurrentItem(m_currentContext.top()); +} + QGraphicsObject *SubcomponentEditorTool::currentRootItem() const { return m_currentContext.top(); diff --git a/src/tools/qml/qmlobserver/editor/subcomponenteditortool.h b/src/tools/qml/qmlobserver/editor/subcomponenteditortool.h index b8b88301f87d266a3484203b9dcfd8fcc20a60d7..55914c9a282bb765f7d83d36eda35e5d16e84ebe 100644 --- a/src/tools/qml/qmlobserver/editor/subcomponenteditortool.h +++ b/src/tools/qml/qmlobserver/editor/subcomponenteditortool.h @@ -58,6 +58,7 @@ protected: private slots: void animate(); void contextDestroyed(QObject *context); + void refresh(); private: void aboutToPopContext();