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
qquickdesignersupportpropertychanges.cpp
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
5
6#include <private/qquickpropertychanges_p.h>
7#include <private/qquickstateoperations_p.h>
8
10
12{
13 QQuickPropertyChanges *propertyChange = qobject_cast<QQuickPropertyChanges*>(propertyChanges);
14
15 if (!propertyChange)
16 return;
17
18 propertyChange->attachToState();
19}
20
22{
23 QQuickPropertyChanges *propertyChange = qobject_cast<QQuickPropertyChanges*>(propertyChanges);
24
25 if (!propertyChange)
26 return nullptr;
27
28 return propertyChange->object();
29}
30
32{
33 QQuickPropertyChanges *propertyChange = qobject_cast<QQuickPropertyChanges*>(propertyChanges);
34
35 if (!propertyChange)
36 return;
37
38 propertyChange->removeProperty(QString::fromUtf8(propertyName));
39}
40
42 const QQuickDesignerSupport::PropertyName &propertyName)
43{
44 QQuickPropertyChanges *propertyChange = qobject_cast<QQuickPropertyChanges*>(propertyChanges);
45
46 if (!propertyChange)
47 return QVariant();
48
49 return propertyChange->property(QString::fromUtf8(propertyName));
50}
51
53 const QQuickDesignerSupport::PropertyName &propertyName,
54 const QVariant &value)
55{
56 QQuickPropertyChanges *propertyChange = qobject_cast<QQuickPropertyChanges*>(propertyChanges);
57
58 if (!propertyChange)
59 return;
60
61 propertyChange->changeValue(QString::fromUtf8(propertyName), value);
62}
63
65 const QQuickDesignerSupport::PropertyName &propertyName,
66 const QString &expression)
67{
68 QQuickPropertyChanges *propertyChange = qobject_cast<QQuickPropertyChanges*>(propertyChanges);
69
70 if (!propertyChange)
71 return;
72
73 propertyChange->changeExpression(QString::fromUtf8(propertyName), expression);
74}
75
77{
78 QQuickPropertyChanges *propertyChange = qobject_cast<QQuickPropertyChanges*>(propertyChanges);
79
80 if (!propertyChange)
81 return nullptr;
82
83 return propertyChange->state();
84}
85
87{
88 const QMetaObject *metaObject = &QQuickPropertyChanges::staticMetaObject;
89 return (metaObject->indexOfProperty(propertyName) > 0); // 'restoreEntryValues', 'explicit'
90}
91
93{
94 QQuickPropertyChanges *propertyChange = qobject_cast<QQuickPropertyChanges*>(propertyChanges);
95
96 if (!propertyChange)
97 return;
98
99 propertyChange->detachFromState();
100}
101
103
104
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
Definition qobject.h:103
static QObject * targetObject(QObject *propertyChanges)
static void changeExpression(QObject *propertyChanges, const QQuickDesignerSupport::PropertyName &propertyName, const QString &expression)
static QVariant getProperty(QObject *propertyChanges, const QQuickDesignerSupport::PropertyName &propertyName)
static void changeValue(QObject *propertyChanges, const QQuickDesignerSupport::PropertyName &propertyName, const QVariant &value)
static void removeProperty(QObject *propertyChanges, const QQuickDesignerSupport::PropertyName &propertyName)
static QObject * stateObject(QObject *propertyChanges)
static bool isNormalProperty(const QQuickDesignerSupport::PropertyName &propertyName)
static void detachFromState(QObject *propertyChanges)
void changeExpression(const QString &name, const QString &expression)
void removeProperty(const QString &name)
QVariant property(const QString &name) const
void changeValue(const QString &name, const QVariant &value)
QQuickState * state() const
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:6018
\inmodule QtCore
Definition qvariant.h:65
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
obj metaObject() -> className()
\inmodule QtCore