2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2011-02-22 12:08:19 +01:00
|
|
|
|
2010-11-24 14:52:06 +01:00
|
|
|
#include "propertyabstractcontainer.h"
|
|
|
|
|
|
2013-07-16 17:00:07 +02:00
|
|
|
#include <QDebug>
|
|
|
|
|
|
2010-11-24 14:52:06 +01:00
|
|
|
namespace QmlDesigner {
|
|
|
|
|
|
|
|
|
|
PropertyAbstractContainer::PropertyAbstractContainer()
|
|
|
|
|
: m_instanceId(-1)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-13 10:11:39 +01:00
|
|
|
PropertyAbstractContainer::PropertyAbstractContainer(qint32 instanceId, const PropertyName &name, const TypeName &dynamicTypeName)
|
2010-11-24 14:52:06 +01:00
|
|
|
: m_instanceId(instanceId),
|
|
|
|
|
m_name(name),
|
|
|
|
|
m_dynamicTypeName(dynamicTypeName)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
qint32 PropertyAbstractContainer::instanceId() const
|
|
|
|
|
{
|
|
|
|
|
return m_instanceId;
|
|
|
|
|
}
|
|
|
|
|
|
2013-03-05 12:19:19 +01:00
|
|
|
PropertyName PropertyAbstractContainer::name() const
|
2010-11-24 14:52:06 +01:00
|
|
|
{
|
|
|
|
|
return m_name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool PropertyAbstractContainer::isDynamic() const
|
|
|
|
|
{
|
|
|
|
|
return !m_dynamicTypeName.isEmpty();
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-13 10:11:39 +01:00
|
|
|
TypeName PropertyAbstractContainer::dynamicTypeName() const
|
2010-11-24 14:52:06 +01:00
|
|
|
{
|
|
|
|
|
return m_dynamicTypeName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QDataStream &operator<<(QDataStream &out, const PropertyAbstractContainer &container)
|
|
|
|
|
{
|
|
|
|
|
out << container.instanceId();
|
|
|
|
|
out << container.name();
|
|
|
|
|
out << container.dynamicTypeName();
|
|
|
|
|
|
|
|
|
|
return out;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QDataStream &operator>>(QDataStream &in, PropertyAbstractContainer &container)
|
|
|
|
|
{
|
|
|
|
|
in >> container.m_instanceId;
|
|
|
|
|
in >> container.m_name;
|
|
|
|
|
in >> container.m_dynamicTypeName;
|
|
|
|
|
|
|
|
|
|
return in;
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-16 17:00:07 +02:00
|
|
|
QDebug operator <<(QDebug debug, const PropertyAbstractContainer &container)
|
|
|
|
|
{
|
|
|
|
|
debug.nospace() << "PropertyAbstractContainer("
|
|
|
|
|
<< "instanceId: " << container.instanceId() << ", "
|
|
|
|
|
<< "name: " << container.name();
|
|
|
|
|
|
|
|
|
|
if (!container.dynamicTypeName().isEmpty())
|
|
|
|
|
debug.nospace() << ", " << "dynamicTypeName: " << container.dynamicTypeName();
|
|
|
|
|
|
|
|
|
|
debug.nospace() << ")";
|
|
|
|
|
|
|
|
|
|
return debug;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2010-11-24 14:52:06 +01:00
|
|
|
} // namespace QmlDesigner
|