Commit fd9d39c1 authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner.Instances: properly disable component complete for 5.1

This is only available in Qt 5.1

Change-Id: I76b7916b4ce64c440c175e77edc2b0a3ef015166
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
parent 45756697
...@@ -53,6 +53,32 @@ ...@@ -53,6 +53,32 @@
#include <private/qquickanimation_p.h> #include <private/qquickanimation_p.h>
#include <private/qqmltimer_p.h> #include <private/qqmltimer_p.h>
#include <private/qqmlengine_p.h> #include <private/qqmlengine_p.h>
#include <designersupport.h>
namespace {
class ComponentCompleteDisabler
{
public:
#if (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0))
ComponentCompleteDisabler()
{
DesignerSupport::disableComponentComplete();
}
~ComponentCompleteDisabler()
{
DesignerSupport::enableComponentComplete();
}
#else
ComponentCompleteDisabler()
{
//nothing not available yet
}
#endif
};
} //namespace
static bool isPropertyBlackListed(const QmlDesigner::PropertyName &propertyName) static bool isPropertyBlackListed(const QmlDesigner::PropertyName &propertyName)
{ {
...@@ -894,6 +920,10 @@ void tweakObjects(QObject *object) ...@@ -894,6 +920,10 @@ void tweakObjects(QObject *object)
QObject *ObjectNodeInstance::createComponentWrap(const QString &nodeSource, const QStringList &imports, QQmlContext *context) QObject *ObjectNodeInstance::createComponentWrap(const QString &nodeSource, const QStringList &imports, QQmlContext *context)
{ {
ComponentCompleteDisabler disableComponentComplete;
Q_UNUSED(disableComponentComplete)
QQmlComponent *component = new QQmlComponent(context->engine()); QQmlComponent *component = new QQmlComponent(context->engine());
QByteArray importArray; QByteArray importArray;
...@@ -949,6 +979,10 @@ static inline QString fixComponentPathForIncompatibleQt(const QString &component ...@@ -949,6 +979,10 @@ static inline QString fixComponentPathForIncompatibleQt(const QString &component
QObject *ObjectNodeInstance::createComponent(const QString &componentPath, QQmlContext *context) QObject *ObjectNodeInstance::createComponent(const QString &componentPath, QQmlContext *context)
{ {
ComponentCompleteDisabler disableComponentComplete;
Q_UNUSED(disableComponentComplete)
QQmlComponent component(context->engine(), fixComponentPathForIncompatibleQt(componentPath)); QQmlComponent component(context->engine(), fixComponentPathForIncompatibleQt(componentPath));
QObject *object = component.beginCreate(context); QObject *object = component.beginCreate(context);
...@@ -968,6 +1002,10 @@ QObject *ObjectNodeInstance::createComponent(const QString &componentPath, QQmlC ...@@ -968,6 +1002,10 @@ QObject *ObjectNodeInstance::createComponent(const QString &componentPath, QQmlC
QObject *ObjectNodeInstance::createCustomParserObject(const QString &nodeSource, const QStringList &imports, QQmlContext *context) QObject *ObjectNodeInstance::createCustomParserObject(const QString &nodeSource, const QStringList &imports, QQmlContext *context)
{ {
ComponentCompleteDisabler disableComponentComplete;
Q_UNUSED(disableComponentComplete)
QQmlComponent component(context->engine()); QQmlComponent component(context->engine());
QByteArray importArray; QByteArray importArray;
......
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