forked from qt-creator/qt-creator
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:
@@ -104,9 +104,8 @@ Edit3DCameraAction::Edit3DCameraAction(const QByteArray &menuId,
|
||||
|
||||
bool Edit3DCameraAction::isEnabled(const SelectionContext &selectionContext) const
|
||||
{
|
||||
return Utils::anyOf(selectionContext.selectedModelNodes(), [](const ModelNode &node) {
|
||||
return node.isValid() && node.metaInfo().isQtQuick3DCamera();
|
||||
});
|
||||
return Utils::anyOf(selectionContext.selectedModelNodes(),
|
||||
[](const ModelNode &node) { return node.metaInfo().isQtQuick3DCamera(); });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
// 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);
|
||||
if (!data.isEmpty()) {
|
||||
QDataStream stream(data);
|
||||
|
||||
@@ -321,9 +321,8 @@ void Edit3DWidget::dropEvent(QDropEvent *dropEvent)
|
||||
QDataStream stream(data);
|
||||
qint32 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());
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user