forked from qt-creator/qt-creator
QmlDesigner: Fix merge conflicts
Task-number: QDS-7723 Change-Id: Id788bb89dc9734c77e01302d9ce50fcb712c67bb Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -88,9 +88,11 @@ QVariant PropertyModel::data(const QModelIndex &index, int role) const
|
|||||||
if (!propertyChanges.target().isValid())
|
if (!propertyChanges.target().isValid())
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
return {};
|
return propertyChanges.target()
|
||||||
// return propertyChanges.target().metaInfo().propertyType(
|
.metaInfo()
|
||||||
// m_properties.at(index.row()).name());
|
.property(m_properties.at(index.row()).name())
|
||||||
|
.propertyType()
|
||||||
|
.typeName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
|
@@ -285,37 +285,41 @@ bool StatesEditorModel::hasAnnotation(int internalNodeId) const
|
|||||||
|
|
||||||
QStringList StatesEditorModel::stateGroups() const
|
QStringList StatesEditorModel::stateGroups() const
|
||||||
{
|
{
|
||||||
return {};
|
if (!m_statesEditorView->isAttached())
|
||||||
// auto stateGroups = Utils::transform(m_statesEditorView->allModelNodesOfType(
|
return {};
|
||||||
// "QtQuick.StateGroup"),
|
|
||||||
// [](const ModelNode &node) { return node.displayName(); });
|
const auto groupMetaInfo = m_statesEditorView->model()->qtQuickStateGroupMetaInfo();
|
||||||
// stateGroups.prepend(tr("Root"));
|
|
||||||
// return stateGroups;
|
auto stateGroups = Utils::transform(m_statesEditorView->allModelNodesOfType(groupMetaInfo),
|
||||||
|
[](const ModelNode &node) { return node.displayName(); });
|
||||||
|
stateGroups.prepend(tr("Root"));
|
||||||
|
return stateGroups;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString StatesEditorModel::activeStateGroup() const
|
QString StatesEditorModel::activeStateGroup() const
|
||||||
{
|
{
|
||||||
|
if (auto stateGroup = m_statesEditorView->activeStatesGroupNode())
|
||||||
|
return stateGroup.displayName();
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
// auto stateGroup = m_statesEditorView->activeStatesGroupNode();
|
|
||||||
|
|
||||||
// if (!stateGroup.isValid())
|
|
||||||
// return QString();
|
|
||||||
|
|
||||||
// return stateGroup.displayName();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StatesEditorModel::setActiveStateGroup(const QString &name)
|
void StatesEditorModel::setActiveStateGroup(const QString &name)
|
||||||
{
|
{
|
||||||
// auto modelNode = Utils::findOrDefault(m_statesEditorView->allModelNodesOfType(
|
if (!m_statesEditorView->isAttached())
|
||||||
// "QtQuick.StateGroup"),
|
return;
|
||||||
// [&name](const ModelNode &node) {
|
|
||||||
// return node.displayName() == name;
|
|
||||||
// });
|
|
||||||
|
|
||||||
// QTC_ASSERT(!modelNode.isValid(), return );
|
const auto groupMetaInfo = m_statesEditorView->model()->qtQuickStateGroupMetaInfo();
|
||||||
|
|
||||||
// if (modelNode.isValid())
|
auto modelNode = Utils::findOrDefault(m_statesEditorView->allModelNodesOfType(groupMetaInfo),
|
||||||
// m_statesEditorView->setActiveStatesGroupNode(modelNode);
|
[&name](const ModelNode &node) {
|
||||||
|
return node.displayName() == name;
|
||||||
|
});
|
||||||
|
|
||||||
|
QTC_ASSERT(!modelNode.isValid(), return );
|
||||||
|
|
||||||
|
if (modelNode.isValid())
|
||||||
|
m_statesEditorView->setActiveStatesGroupNode(modelNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
int StatesEditorModel::activeStateGroupIndex() const
|
int StatesEditorModel::activeStateGroupIndex() const
|
||||||
|
@@ -111,17 +111,18 @@ void StatesEditorView::setActiveStatesGroupNode(const ModelNode &modelNode)
|
|||||||
int StatesEditorView::activeStatesGroupIndex() const
|
int StatesEditorView::activeStatesGroupIndex() const
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
// return Utils::indexOf(allModelNodesOfType("QtQuick.StateGroup"),
|
return Utils::indexOf(allModelNodesOfType(model()->qtQuickStateGroupMetaInfo()),
|
||||||
// [this](const ModelNode &node) { return node == m_activeStatesGroupNode; })
|
[this](const ModelNode &node) { return node == m_activeStatesGroupNode; })
|
||||||
// + 1;
|
+ 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StatesEditorView::setActiveStatesGroupIndex(int index)
|
void StatesEditorView::setActiveStatesGroupIndex(int index)
|
||||||
{
|
{
|
||||||
if (index > 0) {
|
if (index > 0) {
|
||||||
// const ModelNode statesGroup = allModelNodesOfType("QtQuick.StateGroup").at(index - 1);
|
const ModelNode statesGroup = allModelNodesOfType(model()->qtQuickStateGroupMetaInfo())
|
||||||
// if (statesGroup.isValid())
|
.at(index - 1);
|
||||||
// setActiveStatesGroupNode(statesGroup);
|
if (statesGroup.isValid())
|
||||||
|
setActiveStatesGroupNode(statesGroup);
|
||||||
} else {
|
} else {
|
||||||
setActiveStatesGroupNode(rootModelNode());
|
setActiveStatesGroupNode(rootModelNode());
|
||||||
}
|
}
|
||||||
|
@@ -596,14 +596,14 @@ QList<ModelNode> QmlObjectNode::allTimelines() const
|
|||||||
|
|
||||||
QList<ModelNode> QmlObjectNode::getAllConnections() const
|
QList<ModelNode> QmlObjectNode::getAllConnections() const
|
||||||
{
|
{
|
||||||
// if (!isValid())
|
if (!isValid())
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
// auto list = view()->allModelNodesOfType("QtQuick.Connections");
|
auto list = view()->allModelNodesOfType(model()->qtQuickConnectionsMetaInfo());
|
||||||
// return Utils::filtered(list, [this](const ModelNode &connection) {
|
return Utils::filtered(list, [this](const ModelNode &connection) {
|
||||||
// return connection.hasBindingProperty("target")
|
return connection.hasBindingProperty("target")
|
||||||
// && connection.bindingProperty("target").resolveToModelNode() == modelNode();
|
&& connection.bindingProperty("target").resolveToModelNode() == modelNode();
|
||||||
// });
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Reference in New Issue
Block a user