Files
qt-creator/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/layoutnodeinstance.cpp
Lucie Gérard a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00

59 lines
1.2 KiB
C++

// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "layoutnodeinstance.h"
#include <QCoreApplication>
namespace QmlDesigner {
namespace Internal {
LayoutNodeInstance::LayoutNodeInstance(QQuickItem *item)
: QuickItemNodeInstance(item)
{
}
bool LayoutNodeInstance::isLayoutable() const
{
return true;
}
bool LayoutNodeInstance::isResizable() const
{
return true;
}
LayoutNodeInstance::Pointer LayoutNodeInstance::create(QObject *object)
{
QQuickItem *item = qobject_cast<QQuickItem*>(object);
Q_ASSERT(item);
Pointer instance(new LayoutNodeInstance(item));
instance->setHasContent(anyItemHasContent(item));
item->setFlag(QQuickItem::ItemHasContents, true);
static_cast<QQmlParserStatus*>(item)->classBegin();
instance->populateResetHashes();
return instance;
}
void LayoutNodeInstance::refreshLayoutable()
{
if (quickItem()->parent())
QCoreApplication::postEvent(quickItem(), new QEvent(QEvent::LayoutRequest));
}
PropertyNameList LayoutNodeInstance::ignoredProperties() const
{
static const PropertyNameList properties({"move", "add", "populate"});
return properties;
}
}
} // namespace QmlDesigner