forked from qt-creator/qt-creator
QmlDesigner.Instances: properly disable component complete for 5.1
This is only available in Qt 5.1 Change-Id: I76b7916b4ce64c440c175e77edc2b0a3ef015166 Reviewed-by: Marco Bubke <marco.bubke@digia.com>
This commit is contained in:
@@ -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)
|
|||||||
|
|
||||||
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
|
|||||||
|
|
||||||
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
|
|||||||
|
|
||||||
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;
|
||||||
|
Reference in New Issue
Block a user