2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2015-05-19 13:11:39 +02:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2015-05-19 13:11:39 +02:00
|
|
|
|
2015-05-18 19:09:33 +02:00
|
|
|
#include "nodeinstanceglobal.h"
|
|
|
|
|
|
2015-05-19 13:11:39 +02:00
|
|
|
#include <QObject>
|
2015-05-18 19:09:33 +02:00
|
|
|
#include <QString>
|
2015-05-19 16:11:35 +02:00
|
|
|
#include <QVariant>
|
2015-05-18 19:09:33 +02:00
|
|
|
#include <QQmlContext>
|
2015-05-19 16:06:19 +02:00
|
|
|
#include <QQmlListReference>
|
2015-05-19 17:03:45 +02:00
|
|
|
#include <QQuickItem>
|
2015-05-19 13:11:39 +02:00
|
|
|
|
|
|
|
|
namespace QmlDesigner {
|
2015-05-20 15:01:55 +02:00
|
|
|
|
|
|
|
|
class NodeInstanceServer;
|
|
|
|
|
|
2015-05-19 13:11:39 +02:00
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class ObjectNodeInstance;
|
|
|
|
|
typedef QSharedPointer<ObjectNodeInstance> ObjectNodeInstancePointer;
|
|
|
|
|
typedef QWeakPointer<ObjectNodeInstance> ObjectNodeInstanceWeakPointer;
|
|
|
|
|
|
2015-05-19 10:15:40 +02:00
|
|
|
namespace QmlPrivateGate {
|
|
|
|
|
|
2015-05-18 19:09:33 +02:00
|
|
|
class ComponentCompleteDisabler
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0))
|
|
|
|
|
ComponentCompleteDisabler();
|
|
|
|
|
|
|
|
|
|
~ComponentCompleteDisabler();
|
|
|
|
|
#else
|
|
|
|
|
ComponentCompleteDisabler()
|
|
|
|
|
{
|
|
|
|
|
//nothing not available yet
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
};
|
|
|
|
|
|
2015-05-20 20:45:48 +02:00
|
|
|
void createNewDynamicProperty(QObject *object, QQmlEngine *engine, const QString &name);
|
|
|
|
|
void registerNodeInstanceMetaObject(QObject *object, QQmlEngine *engine);
|
2015-05-19 10:54:16 +02:00
|
|
|
QVariant fixResourcePaths(const QVariant &value);
|
2015-05-18 19:09:33 +02:00
|
|
|
QObject *createPrimitive(const QString &typeName, int majorNumber, int minorNumber, QQmlContext *context);
|
2015-05-19 10:12:52 +02:00
|
|
|
QObject *createComponent(const QUrl &componentUrl, QQmlContext *context);
|
2015-05-18 19:09:33 +02:00
|
|
|
void tweakObjects(QObject *object);
|
|
|
|
|
bool isPropertyBlackListed(const QmlDesigner::PropertyName &propertyName);
|
|
|
|
|
PropertyNameList propertyNameListForWritableProperties(QObject *object,
|
|
|
|
|
const PropertyName &baseName = PropertyName(),
|
2019-07-31 17:21:41 +02:00
|
|
|
QObjectList *inspectedObjects = nullptr);
|
2021-07-07 13:04:37 +02:00
|
|
|
PropertyNameList allPropertyNames(QObject *object);
|
2015-05-19 16:06:19 +02:00
|
|
|
bool hasFullImplementedListInterface(const QQmlListReference &list);
|
2015-05-19 10:04:50 +02:00
|
|
|
|
2015-05-19 16:37:55 +02:00
|
|
|
void registerCustomData(QObject *object);
|
2015-05-19 16:11:35 +02:00
|
|
|
QVariant getResetValue(QObject *object, const PropertyName &propertyName);
|
2015-05-19 16:37:55 +02:00
|
|
|
void doResetProperty(QObject *object, QQmlContext *context, const PropertyName &propertyName);
|
2015-05-19 16:11:35 +02:00
|
|
|
bool hasValidResetBinding(QObject *object, const PropertyName &propertyName);
|
2015-05-20 16:35:58 +02:00
|
|
|
|
2015-05-19 16:37:55 +02:00
|
|
|
bool hasBindingForProperty(QObject *object, QQmlContext *context, const PropertyName &propertyName, bool *hasChanged);
|
|
|
|
|
void setPropertyBinding(QObject *object, QQmlContext *context, const PropertyName &propertyName, const QString &expression);
|
2015-05-19 16:48:47 +02:00
|
|
|
void keepBindingFromGettingDeleted(QObject *object, QQmlContext *context, const PropertyName &propertyName);
|
2015-05-19 16:11:35 +02:00
|
|
|
|
2018-10-18 15:45:04 +02:00
|
|
|
void emitComponentComplete(QObject *item);
|
2015-05-20 15:01:55 +02:00
|
|
|
void doComponentCompleteRecursive(QObject *object, NodeInstanceServer *nodeInstanceServer);
|
|
|
|
|
|
2015-05-19 16:54:38 +02:00
|
|
|
bool objectWasDeleted(QObject *object);
|
2015-05-19 17:03:45 +02:00
|
|
|
void disableNativeTextRendering(QQuickItem *item);
|
|
|
|
|
void disableTextCursor(QQuickItem *item);
|
2015-05-19 17:06:48 +02:00
|
|
|
void disableTransition(QObject *object);
|
2015-05-19 14:44:47 +02:00
|
|
|
void disableBehaivour(QObject *object);
|
2015-05-19 15:04:36 +02:00
|
|
|
void stopUnifiedTimer();
|
2015-05-20 16:35:58 +02:00
|
|
|
bool isPropertyQObject(const QMetaProperty &metaProperty);
|
|
|
|
|
QObject *readQObjectProperty(const QMetaProperty &metaProperty, QObject *object);
|
|
|
|
|
|
2015-05-20 18:29:07 +02:00
|
|
|
namespace States {
|
|
|
|
|
|
|
|
|
|
bool isStateActive(QObject *object, QQmlContext *context);
|
|
|
|
|
void activateState(QObject *object, QQmlContext *context);
|
|
|
|
|
void deactivateState(QObject *object);
|
|
|
|
|
bool changeValueInRevertList(QObject *state, QObject *target, const PropertyName &propertyName, const QVariant &value);
|
|
|
|
|
bool updateStateBinding(QObject *state, QObject *target, const PropertyName &propertyName, const QString &expression);
|
|
|
|
|
bool resetStateProperty(QObject *state, QObject *target, const PropertyName &propertyName, const QVariant &);
|
|
|
|
|
|
|
|
|
|
} //namespace States
|
2015-05-19 16:54:38 +02:00
|
|
|
|
2015-05-20 18:30:37 +02:00
|
|
|
namespace PropertyChanges {
|
|
|
|
|
|
|
|
|
|
void detachFromState(QObject *propertyChanges);
|
|
|
|
|
void attachToState(QObject *propertyChanges);
|
|
|
|
|
QObject *targetObject(QObject *propertyChanges);
|
|
|
|
|
void removeProperty(QObject *propertyChanges, const PropertyName &propertyName);
|
|
|
|
|
QVariant getProperty(QObject *propertyChanges, const PropertyName &propertyName);
|
|
|
|
|
void changeValue(QObject *propertyChanges, const PropertyName &propertyName, const QVariant &value);
|
|
|
|
|
void changeExpression(QObject *propertyChanges, const PropertyName &propertyName, const QString &expression);
|
|
|
|
|
QObject *stateObject(QObject *propertyChanges);
|
|
|
|
|
bool isNormalProperty(const PropertyName &propertyName);
|
|
|
|
|
|
|
|
|
|
} // namespace PropertyChanges
|
|
|
|
|
|
2015-05-21 11:47:27 +02:00
|
|
|
|
2015-05-20 18:09:54 +02:00
|
|
|
bool isSubclassOf(QObject *object, const QByteArray &superTypeName);
|
|
|
|
|
void getPropertyCache(QObject *object, QQmlEngine *engine);
|
2015-05-20 18:30:37 +02:00
|
|
|
|
2015-05-21 11:47:27 +02:00
|
|
|
void registerNotifyPropertyChangeCallBack(void (*callback)(QObject *, const PropertyName &));
|
|
|
|
|
|
2016-06-10 16:04:33 +02:00
|
|
|
void registerFixResourcePathsForObjectCallBack();
|
|
|
|
|
|
2015-05-19 13:11:39 +02:00
|
|
|
} // namespace QmlPrivateGate
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace QmlDesigner
|