9#include <QGlobalStatic>
13#include <private/qqmlanybinding_p.h>
27QQuickDesignerCustomObjectData::QQuickDesignerCustomObjectData(
QObject *
object)
31 populateResetHashes();
32 s_designerObjectToDataHash()->insert(
object,
this);
47 return s_designerObjectToDataHash()->value(
object);
55 return data->getResetValue(propertyName);
73 return data->hasValidResetBinding(propertyName);
86 return data->hasBindingForProperty(
context, propertyName, hasChanged);
99 data->setPropertyBinding(
context, propertyName, expression);
109 data->keepBindingFromGettingDeleted(
context, propertyName);
112void QQuickDesignerCustomObjectData::populateResetHashes()
119 const int namesIndex =
mo->indexOfClassInfo(
"DeferredPropertyNames");
120 if (namesIndex != -1) {
127 if (deferredPropertyNames.contains(propertyName))
135 m_resetBindingHash.insert(propertyName, binding);
137 m_resetValueHash.insert(propertyName,
property.read());
142QObject *QQuickDesignerCustomObjectData::object()
const
149 return m_resetValueHash.value(propertyName);
172 }
else if (
property.isResettable()) {
178 qWarning() <<
"Property list interface not fully implemented for Class " <<
property.property().typeName() <<
" in property " <<
property.name() <<
"!";
193 return m_resetBindingHash.contains(propertyName) && m_resetBindingHash.value(propertyName);
198 return m_resetBindingHash.value(propertyName);
203 bool *hasChanged)
const
213 *hasChanged = hasBinding != m_hasBindingHash.value(propertyName,
false);
215 m_hasBindingHash.insert(propertyName, hasBinding);
243 if (
property.property().userType() == QMetaType::QString)
248 qWarning() <<
Q_FUNC_INFO <<
": Cannot set binding for property" << propertyName <<
": property is unknown for type";
262 s_designerObjectToDataHash()->remove(m_object);
QList< QByteArray > split(char sep) const
Splits the byte array into subarrays wherever sep occurs, and returns the list of those arrays.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
QQmlAnyBinding is an abstraction over the various bindings in QML.
static QQmlAnyBinding createFromCodeString(const QQmlProperty &prop, const QString &code, QObject *obj, const QQmlRefPointer< QQmlContextData > &ctxt, const QString &url, quint16 lineNumber)
static QQmlAnyBinding takeFrom(const QQmlProperty &prop)
Removes the binding from the property prop, and returns it as a QQmlAnyBinding if there was any.
QQmlAbstractBinding * asAbstractBinding() const
void installOn(const QQmlProperty &target, InterceptorMode mode=IgnoreInterceptors)
bool isAbstractPropertyBinding() const
static QQmlAnyBinding ofProperty(const QQmlProperty &prop)
static QQmlRefPointer< QQmlContextData > get(QQmlContext *context)
The QQmlContext class defines a context within a QML engine.
static QQmlContext * contextForObject(const QObject *)
Returns the QQmlContext for the object, or nullptr if no context has been set.
The QQmlListReference class allows the manipulation of QQmlListProperty properties.
The QQmlProperty class abstracts accessing properties on objects created from QML.
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 void registerData(QObject *object)
static QQuickDesignerCustomObjectData * get(QObject *object)
static QQuickDesignerSupport::PropertyNameList propertyNameListForWritableProperties(QObject *object)
static bool hasFullImplementedListInterface(const QQmlListReference &list)
static bool isPropertyBlackListed(const QQuickDesignerSupport::PropertyName &propertyName)
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Combined button and popup list for selecting options.
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
QHash< QObject *, QQuickDesignerCustomObjectData * > CustomObjectDataHash
QUrl url("example.com")
[constructor-url-reference]
QQuickDesignerCustomObjectData * data
\inmodule QtCore \reentrant