summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@theqtcompany.com>2015-05-19 17:06:48 +0200
committerThomas Hartmann <Thomas.Hartmann@digia.com>2015-05-20 14:02:17 +0000
commit43d716bb5ab7f933337a51b0f1635715cb15bc6f (patch)
treecbf6bcc1156338337750f3179defa1acdd3415b4 /share
parentd38b1c21a2c4a7096f1385c28aa07e575b7bd325 (diff)
downloadqt-creator-43d716bb5ab7f933337a51b0f1635715cb15bc6f.tar.gz
QmlPuppet: Remove private dependencies from QmlTransitionNodeInstance
Change-Id: I8a5144947469a3c7f368fa6b18781c0d07b4d850 Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Diffstat (limited to 'share')
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmltransitionnodeinstance.cpp20
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmltransitionnodeinstance.h9
-rw-r--r--share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate.cpp9
-rw-r--r--share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate.h1
4 files changed, 16 insertions, 23 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmltransitionnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmltransitionnodeinstance.cpp
index 59c8fe354b..6289e09619 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmltransitionnodeinstance.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmltransitionnodeinstance.cpp
@@ -29,28 +29,23 @@
****************************************************************************/
#include "qmltransitionnodeinstance.h"
-#include <private/qquicktransition_p.h>
+
+#include <qmlprivategate.h>
namespace QmlDesigner {
namespace Internal {
-QmlTransitionNodeInstance::QmlTransitionNodeInstance(QQuickTransition *transition)
+QmlTransitionNodeInstance::QmlTransitionNodeInstance(QObject *transition)
: ObjectNodeInstance(transition)
{
}
QmlTransitionNodeInstance::Pointer QmlTransitionNodeInstance::create(QObject *object)
{
- QQuickTransition *transition = qobject_cast<QQuickTransition*>(object);
-
- Q_ASSERT(transition);
-
- Pointer instance(new QmlTransitionNodeInstance(transition));
+ Pointer instance(new QmlTransitionNodeInstance(object));
instance->populateResetHashes();
-
- transition->setToState("invalidState");
- transition->setFromState("invalidState");
+ QmlPrivateGate::disableTransition(object);
return instance;
}
@@ -65,10 +60,5 @@ PropertyNameList QmlTransitionNodeInstance::ignoredProperties() const
return PropertyNameList() << "from" << "to";
}
-QQuickTransition *QmlTransitionNodeInstance::qmlTransition() const
-{
- Q_ASSERT(qobject_cast<QQuickTransition*>(object()));
- return static_cast<QQuickTransition*>(object());
-}
}
}
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmltransitionnodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmltransitionnodeinstance.h
index 66708c5bdb..69b67228e7 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmltransitionnodeinstance.h
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmltransitionnodeinstance.h
@@ -33,10 +33,6 @@
#include "objectnodeinstance.h"
-QT_BEGIN_NAMESPACE
-class QQuickTransition;
-QT_END_NAMESPACE
-
namespace QmlDesigner {
namespace Internal {
@@ -52,11 +48,8 @@ public:
PropertyNameList ignoredProperties() const Q_DECL_OVERRIDE;
-protected:
- QQuickTransition *qmlTransition() const;
-
private:
- QmlTransitionNodeInstance(QQuickTransition *transition);
+ QmlTransitionNodeInstance(QObject *transition);
};
}
}
diff --git a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate.cpp b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate.cpp
index 4b72bac096..9d941a62e3 100644
--- a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate.cpp
@@ -47,6 +47,7 @@
#include <private/qquicktext_p.h>
#include <private/qquicktextinput_p.h>
#include <private/qquicktextedit_p.h>
+#include <private/qquicktransition_p.h>
#include <designersupport.h>
@@ -555,6 +556,14 @@ void disableTextCursor(QQuickItem *item)
textEdit->setCursorVisible(false);
}
+void disableTransition(QObject *object)
+{
+ QQuickTransition *transition = qobject_cast<QQuickTransition*>(object);
+ Q_ASSERT(transition);
+ transition->setToState("invalidState");
+ transition->setFromState("invalidState");
+}
+
ComponentCompleteDisabler::ComponentCompleteDisabler()
{
DesignerSupport::disableComponentComplete();
diff --git a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate.h b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate.h
index eb60ad7d73..206734aeea 100644
--- a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate.h
+++ b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate.h
@@ -96,6 +96,7 @@ public:
bool objectWasDeleted(QObject *object);
void disableNativeTextRendering(QQuickItem *item);
void disableTextCursor(QQuickItem *item);
+ void disableTransition(QObject *object);
} // namespace QmlPrivateGate
} // namespace Internal