Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickdesignercustomobjectdata_p.h
Go to the documentation of this file.
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 DESIGNERCUSTOMOBJECTDATA_H
5#define DESIGNERCUSTOMOBJECTDATA_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
19
20#include <QHash>
21#include <QObject>
22#include <QVariant>
23
24#include <private/qqmlanybinding_p.h>
25
27class QQmlContext;
28
30{
31public:
32 static void registerData(QObject *object);
34 static QVariant getResetValue(QObject *object, const QQuickDesignerSupport::PropertyName &propertyName);
35 static void doResetProperty(QObject *object, QQmlContext *context, const QQuickDesignerSupport::PropertyName &propertyName);
36 static bool hasValidResetBinding(QObject *object, const QQuickDesignerSupport::PropertyName &propertyName);
37 static bool hasBindingForProperty(QObject *object,
39 const QQuickDesignerSupport::PropertyName &propertyName,
40 bool *hasChanged);
41 static void setPropertyBinding(QObject *object,
43 const QQuickDesignerSupport::PropertyName &propertyName,
44 const QString &expression);
45 static void keepBindingFromGettingDeleted(QObject *object,
47 const QQuickDesignerSupport::PropertyName &propertyName);
48 void handleDestroyed();
49
50private:
52 void populateResetHashes();
53 QObject *object() const;
56 bool hasValidResetBinding(const QQuickDesignerSupport::PropertyName &propertyName) const;
57 QQmlAnyBinding getResetBinding(const QQuickDesignerSupport::PropertyName &propertyName) const;
58 bool hasBindingForProperty(QQmlContext *context, const QQuickDesignerSupport::PropertyName &propertyName, bool *hasChanged) const;
59 void setPropertyBinding(QQmlContext *context, const QQuickDesignerSupport::PropertyName &propertyName, const QString &expression);
61
62 QObject *m_object;
63 QHash<QQuickDesignerSupport::PropertyName, QVariant> m_resetValueHash;
64 QHash<QQuickDesignerSupport::PropertyName, QQmlAnyBinding> m_resetBindingHash;
65 mutable QHash<QQuickDesignerSupport::PropertyName, bool> m_hasBindingHash;
66};
67
69
70#endif // DESIGNERCUSTOMOBJECTDATA_H
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
Definition qobject.h:103
QQmlAnyBinding is an abstraction over the various bindings in QML.
The QQmlContext class defines a context within a QML engine.
Definition qqmlcontext.h:25
static void doResetProperty(QObject *object, QQmlContext *context, const QQuickDesignerSupport::PropertyName &propertyName)
static void setPropertyBinding(QObject *object, QQmlContext *context, const QQuickDesignerSupport::PropertyName &propertyName, const QString &expression)
static bool hasValidResetBinding(QObject *object, const QQuickDesignerSupport::PropertyName &propertyName)
static QVariant getResetValue(QObject *object, const QQuickDesignerSupport::PropertyName &propertyName)
static bool hasBindingForProperty(QObject *object, QQmlContext *context, const QQuickDesignerSupport::PropertyName &propertyName, bool *hasChanged)
static void keepBindingFromGettingDeleted(QObject *object, QQmlContext *context, const QQuickDesignerSupport::PropertyName &propertyName)
static QQuickDesignerCustomObjectData * get(QObject *object)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qvariant.h:65
Combined button and popup list for selecting options.
static void * context
GLuint object
[3]