forked from qt-creator/qt-creator
QmlPuppet: Remove private dependencies from BehaviorNodeInstance
Change-Id: I16f2c4189f7b68bf1cff90d0a9987b4bf4212905 Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
committed by
Thomas Hartmann
parent
43d716bb5a
commit
0d67510270
@@ -30,7 +30,7 @@
|
||||
|
||||
#include "behaviornodeinstance.h"
|
||||
|
||||
#include <private/qquickbehavior_p.h>
|
||||
#include <qmlprivategate.h>
|
||||
|
||||
namespace QmlDesigner {
|
||||
namespace Internal {
|
||||
@@ -43,15 +43,11 @@ BehaviorNodeInstance::BehaviorNodeInstance(QObject *object)
|
||||
|
||||
BehaviorNodeInstance::Pointer BehaviorNodeInstance::create(QObject *object)
|
||||
{
|
||||
QQuickBehavior* behavior = qobject_cast<QQuickBehavior*>(object);
|
||||
|
||||
Q_ASSERT(behavior);
|
||||
|
||||
Pointer instance(new BehaviorNodeInstance(behavior));
|
||||
Pointer instance(new BehaviorNodeInstance(object));
|
||||
|
||||
instance->populateResetHashes();
|
||||
|
||||
behavior->setEnabled(false);
|
||||
QmlPrivateGate::disableBehaivour(object);
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
@@ -42,8 +42,9 @@
|
||||
|
||||
#include <private/qobject_p.h>
|
||||
#include <private/qqmltimer_p.h>
|
||||
#include <private/qquicktransition_p.h>
|
||||
#include <private/qquickanimation_p.h>
|
||||
#include <private/qquicktransition_p.h>
|
||||
#include <private/qquickbehavior_p.h>
|
||||
#include <private/qquicktext_p.h>
|
||||
#include <private/qquicktextinput_p.h>
|
||||
#include <private/qquicktextedit_p.h>
|
||||
@@ -564,6 +565,13 @@ void disableTransition(QObject *object)
|
||||
transition->setFromState("invalidState");
|
||||
}
|
||||
|
||||
void disableBehaivour(QObject *object)
|
||||
{
|
||||
QQuickBehavior* behavior = qobject_cast<QQuickBehavior*>(object);
|
||||
Q_ASSERT(behavior);
|
||||
behavior->setEnabled(false);
|
||||
}
|
||||
|
||||
ComponentCompleteDisabler::ComponentCompleteDisabler()
|
||||
{
|
||||
DesignerSupport::disableComponentComplete();
|
||||
|
@@ -97,6 +97,7 @@ public:
|
||||
void disableNativeTextRendering(QQuickItem *item);
|
||||
void disableTextCursor(QQuickItem *item);
|
||||
void disableTransition(QObject *object);
|
||||
void disableBehaivour(QObject *object);
|
||||
|
||||
} // namespace QmlPrivateGate
|
||||
} // namespace Internal
|
||||
|
Reference in New Issue
Block a user