diff options
-rw-r--r-- | src/qml/qml/qqmlcomponentattached_p.h | 3 | ||||
-rw-r--r-- | src/quick/designer/designersupport.cpp | 13 | ||||
-rw-r--r-- | src/quick/designer/designersupport.h | 1 |
3 files changed, 16 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlcomponentattached_p.h b/src/qml/qml/qqmlcomponentattached_p.h index 3c27e795c6..ae416dcb1c 100644 --- a/src/qml/qml/qqmlcomponentattached_p.h +++ b/src/qml/qml/qqmlcomponentattached_p.h @@ -43,12 +43,13 @@ #define QQMLCOMPONENTATTACHED_P_H #include <QtQml/qqml.h> +#include <private/qtqmlglobal_p.h> #include <QtCore/QObject> QT_BEGIN_NAMESPACE -class Q_AUTOTEST_EXPORT QQmlComponentAttached : public QObject +class Q_QML_PRIVATE_EXPORT QQmlComponentAttached : public QObject { Q_OBJECT public: diff --git a/src/quick/designer/designersupport.cpp b/src/quick/designer/designersupport.cpp index 063fa6ebb1..2dd041b968 100644 --- a/src/quick/designer/designersupport.cpp +++ b/src/quick/designer/designersupport.cpp @@ -51,6 +51,8 @@ #include <QtQuick/private/qquickstategroup_p.h> #include <QtGui/QImage> #include <private/qqmlvme_p.h> +#include <private/qqmlcomponentattached_p.h> +#include <private/qqmldata_p.h> #include "designerwindowmanager_p.h" @@ -375,6 +377,17 @@ void DesignerSupport::resetAnchor(QQuickItem *item, const QString &name) } } +void DesignerSupport::emitComponentCompleteSignalForAttachedProperty(QQuickItem *item) +{ + QQmlData *data = QQmlData::get(item); + if (data && data->context) { + QQmlComponentAttached *componentAttached = data->context->componentAttached; + if (componentAttached) { + emit componentAttached->completed(); + } + } +} + QList<QObject*> DesignerSupport::statesForItem(QQuickItem *item) { QList<QObject*> objectList; diff --git a/src/quick/designer/designersupport.h b/src/quick/designer/designersupport.h index 4567e5c3d8..5139a65645 100644 --- a/src/quick/designer/designersupport.h +++ b/src/quick/designer/designersupport.h @@ -125,6 +125,7 @@ public: static QQuickItem *anchorCenterInTargetItem(QQuickItem *item); static QPair<QString, QObject*> anchorLineTarget(QQuickItem *item, const QString &name, QQmlContext *context); static void resetAnchor(QQuickItem *item, const QString &name); + static void emitComponentCompleteSignalForAttachedProperty(QQuickItem *item); static QList<QObject*> statesForItem(QQuickItem *item); |