| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef DESIGNERSUPPORTPROPERTIES_H |
| 5 | #define DESIGNERSUPPORTPROPERTIES_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include "qquickdesignersupport_p.h" |
| 19 | |
| 20 | #include <QObject> |
| 21 | #include <QString> |
| 22 | #include <QVariant> |
| 23 | #include <QList> |
| 24 | #include <QByteArray> |
| 25 | #include <QQmlContext> |
| 26 | #include <QQmlListReference> |
| 27 | |
| 28 | QT_BEGIN_NAMESPACE |
| 29 | |
| 30 | class Q_QUICK_EXPORT QQuickDesignerSupportProperties |
| 31 | { |
| 32 | public: |
| 33 | static void createNewDynamicProperty(QObject *object, QQmlEngine *engine, const QString &name); |
| 34 | static void registerNodeInstanceMetaObject(QObject *object, QQmlEngine *engine); |
| 35 | static void registerCustomData(QObject *object); |
| 36 | static QVariant getResetValue(QObject *object, const QQuickDesignerSupport::PropertyName &propertyName); |
| 37 | static void doResetProperty(QObject *object, QQmlContext *context, const QQuickDesignerSupport::PropertyName &propertyName); |
| 38 | static bool hasValidResetBinding(QObject *object, const QQuickDesignerSupport::PropertyName &propertyName); |
| 39 | |
| 40 | static bool hasBindingForProperty(QObject *object, |
| 41 | QQmlContext *context, |
| 42 | const QQuickDesignerSupport::PropertyName &propertyName, |
| 43 | bool *hasChanged); |
| 44 | static void setPropertyBinding(QObject *object, |
| 45 | QQmlContext *context, |
| 46 | const QQuickDesignerSupport::PropertyName &propertyName, |
| 47 | const QString &expression); |
| 48 | static void keepBindingFromGettingDeleted(QObject *object, |
| 49 | QQmlContext *context, |
| 50 | const QQuickDesignerSupport::PropertyName &propertyName); |
| 51 | |
| 52 | static bool isPropertyQObject(const QMetaProperty &metaProperty); |
| 53 | static QObject *readQObjectProperty(const QMetaProperty &metaProperty, QObject *object); |
| 54 | |
| 55 | static void getPropertyCache(QObject *object); |
| 56 | static bool isPropertyBlackListed(const QQuickDesignerSupport::PropertyName &propertyName); |
| 57 | static QQuickDesignerSupport::PropertyNameList propertyNameListForWritableProperties(QObject *object); |
| 58 | static QQuickDesignerSupport::PropertyNameList allPropertyNames(QObject *object, |
| 59 | const QQuickDesignerSupport::PropertyName &baseName = QQuickDesignerSupport::PropertyName(), |
| 60 | QObjectList *inspectedObjects = nullptr, |
| 61 | int depth = 0); |
| 62 | static bool hasFullImplementedListInterface(const QQmlListReference &list); |
| 63 | }; |
| 64 | |
| 65 | QT_END_NAMESPACE |
| 66 | |
| 67 | #endif // DESIGNERSUPPORTPROPERTIES_H |
| 68 | |