aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/anchorchangesnodeinstance.h
blob: cab4ba631ad78cd46e6715805e298699f51d6765 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include "objectnodeinstance.h"

#include <QPair>
#include <QWeakPointer>

QT_BEGIN_NAMESPACE
class QQmlProperty;
QT_END_NAMESPACE

namespace QmlDesigner {

namespace Internal {

class AnchorChangesNodeInstance : public ObjectNodeInstance
{
public:
    using Pointer = QSharedPointer<AnchorChangesNodeInstance>;
    using WeakPointer = QWeakPointer<AnchorChangesNodeInstance>;

    static Pointer create(QObject *objectToBeWrapped);

    void setPropertyVariant(const PropertyName &name, const QVariant &value) override;
    void setPropertyBinding(const PropertyName &name, const QString &expression) override;
    QVariant property(const PropertyName &name) const override;
    void resetProperty(const PropertyName &name) override;

    void reparent(const ObjectNodeInstance::Pointer &oldParentInstance,
                  const PropertyName &oldParentProperty,
                  const ObjectNodeInstance::Pointer &newParentInstance,
                  const PropertyName &newParentProperty) override;

protected:
    AnchorChangesNodeInstance(QObject *object);
    QObject *changesObject() const;
};

} // namespace Internal
} // namespace QmlDesigner