QmlDesigner: Use new validation approach in 3D editor

Many validation tests can now be skipped.

Task-number: QDS-7454
Change-Id: I447e106d1b5deb3af92046c6ee8907341c7d5220
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
Marco Bubke
2022-08-31 10:21:21 +02:00
parent 0a6523e7f1
commit 6822b2f04a
3 changed files with 4 additions and 6 deletions

View File

@@ -104,9 +104,8 @@ Edit3DCameraAction::Edit3DCameraAction(const QByteArray &menuId,
bool Edit3DCameraAction::isEnabled(const SelectionContext &selectionContext) const bool Edit3DCameraAction::isEnabled(const SelectionContext &selectionContext) const
{ {
return Utils::anyOf(selectionContext.selectedModelNodes(), [](const ModelNode &node) { return Utils::anyOf(selectionContext.selectedModelNodes(),
return node.isValid() && node.metaInfo().isQtQuick3DCamera(); [](const ModelNode &node) { return node.metaInfo().isQtQuick3DCamera(); });
});
} }
} }

View File

@@ -152,7 +152,7 @@ void Edit3DCanvas::dragEnterEvent(QDragEnterEvent *e)
// Allow drop when there is no valid active scene, as the drop goes under the root node of // Allow drop when there is no valid active scene, as the drop goes under the root node of
// the document in that case. // the document in that case.
if (!node.isValid() || !ModelNode::isThisOrAncestorLocked(node)) { if (!ModelNode::isThisOrAncestorLocked(node)) {
QByteArray data = e->mimeData()->data(Constants::MIME_TYPE_ITEM_LIBRARY_INFO); QByteArray data = e->mimeData()->data(Constants::MIME_TYPE_ITEM_LIBRARY_INFO);
if (!data.isEmpty()) { if (!data.isEmpty()) {
QDataStream stream(data); QDataStream stream(data);

View File

@@ -321,9 +321,8 @@ void Edit3DWidget::dropEvent(QDropEvent *dropEvent)
QDataStream stream(data); QDataStream stream(data);
qint32 internalId; qint32 internalId;
stream >> internalId; stream >> internalId;
ModelNode matNode = m_view->modelNodeForInternalId(internalId);
if (matNode.isValid()) if (ModelNode matNode = m_view->modelNodeForInternalId(internalId))
m_view->dropMaterial(matNode, dropEvent->position()); m_view->dropMaterial(matNode, dropEvent->position());
return; return;
} }