2020-02-11 11:33:25 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** Copyright (C) 2020 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
|
|
|
|
**
|
|
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2021-10-06 11:10:36 +03:00
|
|
|
#include "edit3dactions.h"
|
|
|
|
|
#include "edit3dcanvas.h"
|
|
|
|
|
#include "edit3dview.h"
|
|
|
|
|
#include "edit3dwidget.h"
|
2022-01-21 17:15:01 +02:00
|
|
|
#include "edit3dvisibilitytogglesmenu.h"
|
2021-10-06 11:10:36 +03:00
|
|
|
#include "metainfo.h"
|
2022-08-19 13:04:26 +03:00
|
|
|
#include "modelnodeoperations.h"
|
2020-02-11 11:33:25 +02:00
|
|
|
#include "qmldesignerconstants.h"
|
2021-10-06 11:10:36 +03:00
|
|
|
#include "qmldesignerplugin.h"
|
|
|
|
|
#include "qmlvisualnode.h"
|
2020-02-11 11:33:25 +02:00
|
|
|
#include "viewmanager.h"
|
2021-10-19 10:04:15 +03:00
|
|
|
#include <seekerslider.h>
|
|
|
|
|
#include <nodeinstanceview.h>
|
2020-02-11 11:33:25 +02:00
|
|
|
|
2020-03-20 16:27:55 +02:00
|
|
|
#include <coreplugin/actionmanager/actionmanager.h>
|
|
|
|
|
#include <coreplugin/actionmanager/command.h>
|
2020-03-12 15:55:30 +02:00
|
|
|
#include <coreplugin/icore.h>
|
2020-02-11 11:33:25 +02:00
|
|
|
#include <toolbox.h>
|
2022-08-25 12:27:41 +03:00
|
|
|
#include <utils/qtcassert.h>
|
2020-02-11 11:33:25 +02:00
|
|
|
#include <utils/utilsicons.h>
|
2020-09-18 10:54:22 +02:00
|
|
|
|
|
|
|
|
#include <QActionGroup>
|
2021-09-30 13:42:48 +03:00
|
|
|
#include <QMimeData>
|
2020-02-11 11:33:25 +02:00
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
|
|
|
|
|
namespace QmlDesigner {
|
|
|
|
|
|
2022-08-19 13:04:26 +03:00
|
|
|
Edit3DWidget::Edit3DWidget(Edit3DView *view)
|
|
|
|
|
: m_view(view)
|
2020-02-11 11:33:25 +02:00
|
|
|
{
|
2021-09-30 13:42:48 +03:00
|
|
|
setAcceptDrops(true);
|
|
|
|
|
|
2020-03-12 15:55:30 +02:00
|
|
|
Core::Context context(Constants::C_QMLEDITOR3D);
|
|
|
|
|
m_context = new Core::IContext(this);
|
|
|
|
|
m_context->setContext(context);
|
|
|
|
|
m_context->setWidget(this);
|
|
|
|
|
|
2020-02-11 11:33:25 +02:00
|
|
|
setMouseTracking(true);
|
|
|
|
|
setFocusPolicy(Qt::WheelFocus);
|
|
|
|
|
|
|
|
|
|
auto fillLayout = new QVBoxLayout(this);
|
|
|
|
|
fillLayout->setContentsMargins(0, 0, 0, 0);
|
|
|
|
|
fillLayout->setSpacing(0);
|
|
|
|
|
setLayout(fillLayout);
|
|
|
|
|
|
2021-10-19 10:04:15 +03:00
|
|
|
SeekerSlider *seeker = new SeekerSlider(this);
|
|
|
|
|
seeker->setEnabled(false);
|
|
|
|
|
|
2020-02-11 11:33:25 +02:00
|
|
|
// Initialize toolbar
|
2021-10-19 10:04:15 +03:00
|
|
|
m_toolBox = new ToolBox(seeker, this);
|
2020-02-11 11:33:25 +02:00
|
|
|
fillLayout->addWidget(m_toolBox.data());
|
|
|
|
|
|
|
|
|
|
// Iterate through view actions. A null action indicates a separator and a second null action
|
|
|
|
|
// after separator indicates an exclusive group.
|
2022-01-21 17:15:01 +02:00
|
|
|
auto handleActions = [this, &context](const QVector<Edit3DAction *> &actions, QMenu *menu, bool left) {
|
2020-02-11 11:33:25 +02:00
|
|
|
bool previousWasSeparator = true;
|
|
|
|
|
QActionGroup *group = nullptr;
|
2022-03-03 16:50:10 +02:00
|
|
|
QActionGroup *proxyGroup = nullptr;
|
2020-02-11 11:33:25 +02:00
|
|
|
for (auto action : actions) {
|
|
|
|
|
if (action) {
|
2022-01-21 17:15:01 +02:00
|
|
|
QAction *a = action->action();
|
2020-02-11 11:33:25 +02:00
|
|
|
if (group)
|
2022-01-21 17:15:01 +02:00
|
|
|
group->addAction(a);
|
|
|
|
|
if (menu) {
|
|
|
|
|
menu->addAction(a);
|
|
|
|
|
} else {
|
|
|
|
|
addAction(a);
|
|
|
|
|
if (left)
|
|
|
|
|
m_toolBox->addLeftSideAction(a);
|
|
|
|
|
else
|
|
|
|
|
m_toolBox->addRightSideAction(a);
|
|
|
|
|
}
|
2020-02-11 11:33:25 +02:00
|
|
|
previousWasSeparator = false;
|
2020-03-20 16:27:55 +02:00
|
|
|
|
|
|
|
|
// Register action as creator command to make it configurable
|
|
|
|
|
Core::Command *command = Core::ActionManager::registerAction(
|
2022-01-21 17:15:01 +02:00
|
|
|
a, action->menuId().constData(), context);
|
|
|
|
|
command->setDefaultKeySequence(a->shortcut());
|
2022-03-03 16:50:10 +02:00
|
|
|
if (proxyGroup)
|
|
|
|
|
proxyGroup->addAction(command->action());
|
2022-01-21 17:15:01 +02:00
|
|
|
// Menu actions will have custom tooltips
|
|
|
|
|
if (menu)
|
|
|
|
|
a->setToolTip(command->stringWithAppendedShortcut(a->toolTip()));
|
|
|
|
|
else
|
|
|
|
|
command->augmentActionWithShortcutToolTip(a);
|
|
|
|
|
|
2020-03-20 16:27:55 +02:00
|
|
|
// Clear action shortcut so it doesn't conflict with command's override action
|
2022-01-21 17:15:01 +02:00
|
|
|
a->setShortcut({});
|
2020-02-11 11:33:25 +02:00
|
|
|
} else {
|
|
|
|
|
if (previousWasSeparator) {
|
|
|
|
|
group = new QActionGroup(this);
|
2022-03-03 16:50:10 +02:00
|
|
|
proxyGroup = new QActionGroup(this);
|
2020-02-11 11:33:25 +02:00
|
|
|
previousWasSeparator = false;
|
|
|
|
|
} else {
|
|
|
|
|
group = nullptr;
|
2022-03-03 16:50:10 +02:00
|
|
|
proxyGroup = nullptr;
|
2020-02-11 11:33:25 +02:00
|
|
|
auto separator = new QAction(this);
|
|
|
|
|
separator->setSeparator(true);
|
2022-01-21 17:15:01 +02:00
|
|
|
if (menu) {
|
|
|
|
|
menu->addAction(separator);
|
|
|
|
|
} else {
|
|
|
|
|
addAction(separator);
|
|
|
|
|
if (left)
|
|
|
|
|
m_toolBox->addLeftSideAction(separator);
|
|
|
|
|
else
|
|
|
|
|
m_toolBox->addRightSideAction(separator);
|
|
|
|
|
}
|
2020-02-11 11:33:25 +02:00
|
|
|
previousWasSeparator = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
2022-01-21 17:15:01 +02:00
|
|
|
|
|
|
|
|
handleActions(view->leftActions(), nullptr, true);
|
|
|
|
|
handleActions(view->rightActions(), nullptr, false);
|
|
|
|
|
|
|
|
|
|
m_visibilityTogglesMenu = new Edit3DVisibilityTogglesMenu(this);
|
|
|
|
|
handleActions(view->visibilityToggleActions(), m_visibilityTogglesMenu, false);
|
2020-02-11 11:33:25 +02:00
|
|
|
|
2022-06-02 15:26:41 +03:00
|
|
|
m_backgroundColorMenu = new QMenu(this);
|
|
|
|
|
m_backgroundColorMenu->setToolTipsVisible(true);
|
|
|
|
|
|
2022-05-31 16:19:29 +03:00
|
|
|
handleActions(view->backgroundColorActions(), m_backgroundColorMenu, false);
|
|
|
|
|
|
2022-08-19 13:04:26 +03:00
|
|
|
createContextMenu();
|
|
|
|
|
|
2021-10-19 10:04:15 +03:00
|
|
|
view->setSeeker(seeker);
|
|
|
|
|
seeker->setToolTip(QLatin1String("Seek particle system time when paused."));
|
|
|
|
|
|
2021-12-01 19:19:09 +01:00
|
|
|
QObject::connect(seeker, &SeekerSlider::positionChanged, [seeker](){
|
2021-10-19 10:04:15 +03:00
|
|
|
QmlDesignerPlugin::instance()->viewManager().nodeInstanceView()
|
|
|
|
|
->view3DAction(View3DSeekActionCommand(seeker->position()));
|
|
|
|
|
});
|
|
|
|
|
|
2020-03-19 13:05:36 +02:00
|
|
|
// Onboarding label contains instructions for new users how to get 3D content into the project
|
|
|
|
|
m_onboardingLabel = new QLabel(this);
|
|
|
|
|
QString labelText =
|
2020-04-24 12:21:35 +03:00
|
|
|
tr("Your file does not import Qt Quick 3D.<br><br>"
|
2021-07-02 14:44:38 +02:00
|
|
|
"To create a 3D view, add the QtQuick3D module in the Library view. Or click"
|
2020-04-24 12:21:35 +03:00
|
|
|
" <a href=\"#add_import\"><span style=\"text-decoration:none;color:%1\">here</span></a> "
|
2022-02-16 17:09:37 +01:00
|
|
|
"to add it immediately.<br><br>"
|
2021-07-02 14:44:38 +02:00
|
|
|
"To import 3D assets from another tool, click the \"Add New Assets...\" button in the Assets tab of the Library view.");
|
2020-03-19 13:05:36 +02:00
|
|
|
m_onboardingLabel->setText(labelText.arg(Utils::creatorTheme()->color(Utils::Theme::TextColorLink).name()));
|
|
|
|
|
m_onboardingLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
|
|
|
|
connect(m_onboardingLabel, &QLabel::linkActivated, this, &Edit3DWidget::linkActivated);
|
|
|
|
|
fillLayout->addWidget(m_onboardingLabel.data());
|
|
|
|
|
|
2020-02-11 11:33:25 +02:00
|
|
|
// Canvas is used to render the actual edit 3d view
|
|
|
|
|
m_canvas = new Edit3DCanvas(this);
|
|
|
|
|
fillLayout->addWidget(m_canvas.data());
|
2020-03-19 13:05:36 +02:00
|
|
|
showCanvas(false);
|
2020-02-11 11:33:25 +02:00
|
|
|
}
|
|
|
|
|
|
2022-08-19 13:04:26 +03:00
|
|
|
void Edit3DWidget::createContextMenu()
|
|
|
|
|
{
|
|
|
|
|
m_contextMenu = new QMenu(this);
|
|
|
|
|
m_editMaterialAction = m_contextMenu->addAction(tr("Edit Material"), [&] {
|
|
|
|
|
SelectionContext selCtx(m_view);
|
|
|
|
|
selCtx.setTargetNode(m_contextMenuTarget);
|
|
|
|
|
ModelNodeOperations::editMaterial(selCtx);
|
|
|
|
|
});
|
|
|
|
|
|
2022-08-23 15:19:56 +03:00
|
|
|
m_deleteAction = m_contextMenu->addAction(tr("Delete"), [&] {
|
|
|
|
|
view()->executeInTransaction("Edit3DWidget::createContextMenu", [&] {
|
|
|
|
|
for (ModelNode &node : m_view->selectedModelNodes())
|
|
|
|
|
node.destroy();
|
|
|
|
|
});
|
|
|
|
|
});
|
2022-08-19 13:04:26 +03:00
|
|
|
}
|
|
|
|
|
|
2022-08-26 17:45:11 +03:00
|
|
|
// Called by the view to update the "create" sub-menu when the Quick3D entries are ready.
|
|
|
|
|
void Edit3DWidget::updateCreateSubMenu(const QStringList &keys,
|
|
|
|
|
const QHash<QString, QList<ItemLibraryEntry>> &entriesMap)
|
2022-08-25 12:27:41 +03:00
|
|
|
{
|
|
|
|
|
if (!m_contextMenu)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (m_createSubMenu) {
|
|
|
|
|
m_contextMenu->removeAction(m_createSubMenu->menuAction());
|
|
|
|
|
m_createSubMenu.clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_nameToEntry.clear();
|
|
|
|
|
m_createSubMenu = m_contextMenu->addMenu(tr("Create"));
|
|
|
|
|
|
2022-08-26 17:45:11 +03:00
|
|
|
for (const QString &cat : keys) {
|
|
|
|
|
QList<ItemLibraryEntry> entries = entriesMap.value(cat);
|
|
|
|
|
if (entries.isEmpty())
|
|
|
|
|
continue;
|
|
|
|
|
|
2022-08-25 12:27:41 +03:00
|
|
|
QMenu *catMenu = m_createSubMenu->addMenu(cat);
|
|
|
|
|
|
|
|
|
|
std::sort(entries.begin(), entries.end(), [](const ItemLibraryEntry &a, const ItemLibraryEntry &b) {
|
|
|
|
|
return a.name() < b.name();
|
|
|
|
|
});
|
2022-08-26 17:45:11 +03:00
|
|
|
|
2022-08-25 12:27:41 +03:00
|
|
|
for (const ItemLibraryEntry &entry : std::as_const(entries)) {
|
|
|
|
|
QAction *action = catMenu->addAction(entry.name(), this, &Edit3DWidget::onCreateAction);
|
|
|
|
|
action->setData(entry.name());
|
|
|
|
|
m_nameToEntry.insert(entry.name(), entry);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Action triggered from the "create" sub-menu
|
|
|
|
|
void Edit3DWidget::onCreateAction()
|
|
|
|
|
{
|
|
|
|
|
QAction *action = qobject_cast<QAction *>(sender());
|
|
|
|
|
if (!action)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
m_view->executeInTransaction(__FUNCTION__, [&] {
|
|
|
|
|
int activeScene = m_view->rootModelNode().auxiliaryData("active3dScene@Internal").toInt();
|
|
|
|
|
|
|
|
|
|
auto modelNode = QmlVisualNode::createQml3DNode(m_view, m_nameToEntry.value(action->data().toString()),
|
|
|
|
|
activeScene).modelNode();
|
|
|
|
|
QTC_ASSERT(modelNode.isValid(), return);
|
|
|
|
|
m_view->setSelectedModelNode(modelNode);
|
|
|
|
|
|
|
|
|
|
// if added node is a Model, assign it a material
|
|
|
|
|
if (modelNode.isSubclassOf("QtQuick3D.Model"))
|
|
|
|
|
m_view->assignMaterialTo3dModel(modelNode);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-12 15:55:30 +02:00
|
|
|
void Edit3DWidget::contextHelp(const Core::IContext::HelpCallback &callback) const
|
|
|
|
|
{
|
|
|
|
|
if (m_view)
|
|
|
|
|
m_view->contextHelp(callback);
|
|
|
|
|
|
|
|
|
|
callback({});
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-19 13:05:36 +02:00
|
|
|
void Edit3DWidget::showCanvas(bool show)
|
|
|
|
|
{
|
|
|
|
|
if (!show) {
|
|
|
|
|
QImage emptyImage;
|
|
|
|
|
m_canvas->updateRenderImage(emptyImage);
|
|
|
|
|
}
|
|
|
|
|
m_canvas->setVisible(show);
|
|
|
|
|
m_onboardingLabel->setVisible(!show);
|
2022-01-21 17:15:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QMenu *Edit3DWidget::visibilityTogglesMenu() const
|
|
|
|
|
{
|
|
|
|
|
return m_visibilityTogglesMenu.data();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Edit3DWidget::showVisibilityTogglesMenu(bool show, const QPoint &pos)
|
|
|
|
|
{
|
|
|
|
|
if (m_visibilityTogglesMenu.isNull())
|
|
|
|
|
return;
|
|
|
|
|
if (show)
|
|
|
|
|
m_visibilityTogglesMenu->popup(pos);
|
|
|
|
|
else
|
|
|
|
|
m_visibilityTogglesMenu->close();
|
2022-05-31 16:19:29 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QMenu *Edit3DWidget::backgroundColorMenu() const
|
|
|
|
|
{
|
|
|
|
|
return m_backgroundColorMenu.data();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Edit3DWidget::showBackgroundColorMenu(bool show, const QPoint &pos)
|
|
|
|
|
{
|
|
|
|
|
if (m_backgroundColorMenu.isNull())
|
|
|
|
|
return;
|
|
|
|
|
if (show)
|
|
|
|
|
m_backgroundColorMenu->popup(pos);
|
|
|
|
|
else
|
|
|
|
|
m_backgroundColorMenu->close();
|
2020-03-19 13:05:36 +02:00
|
|
|
}
|
|
|
|
|
|
2022-08-19 13:04:26 +03:00
|
|
|
void Edit3DWidget::showContextMenu(const QPoint &pos, const ModelNode &modelNode)
|
|
|
|
|
{
|
|
|
|
|
m_contextMenuTarget = modelNode;
|
|
|
|
|
|
|
|
|
|
m_editMaterialAction->setEnabled(modelNode.isValid());
|
2022-08-23 15:19:56 +03:00
|
|
|
m_deleteAction->setEnabled(modelNode.isValid());
|
2022-08-19 13:04:26 +03:00
|
|
|
|
|
|
|
|
m_contextMenu->popup(mapToGlobal(pos));
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-19 13:05:36 +02:00
|
|
|
void Edit3DWidget::linkActivated(const QString &link)
|
|
|
|
|
{
|
2020-03-30 15:56:55 +02:00
|
|
|
Q_UNUSED(link)
|
2020-03-19 13:05:36 +02:00
|
|
|
if (m_view)
|
|
|
|
|
m_view->addQuick3DImport();
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-11 11:33:25 +02:00
|
|
|
Edit3DCanvas *Edit3DWidget::canvas() const
|
|
|
|
|
{
|
|
|
|
|
return m_canvas.data();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Edit3DView *Edit3DWidget::view() const
|
|
|
|
|
{
|
|
|
|
|
return m_view.data();
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-30 13:42:48 +03:00
|
|
|
void Edit3DWidget::dragEnterEvent(QDragEnterEvent *dragEnterEvent)
|
|
|
|
|
{
|
|
|
|
|
const DesignerActionManager &actionManager = QmlDesignerPlugin::instance()
|
|
|
|
|
->viewManager().designerActionManager();
|
2022-07-01 11:35:09 +03:00
|
|
|
if (actionManager.externalDragHasSupportedAssets(dragEnterEvent->mimeData())
|
|
|
|
|
|| dragEnterEvent->mimeData()->hasFormat(Constants::MIME_TYPE_MATERIAL)) {
|
2021-09-30 13:42:48 +03:00
|
|
|
dragEnterEvent->acceptProposedAction();
|
2022-07-01 11:35:09 +03:00
|
|
|
}
|
2021-09-30 13:42:48 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Edit3DWidget::dropEvent(QDropEvent *dropEvent)
|
|
|
|
|
{
|
2022-07-01 11:35:09 +03:00
|
|
|
// handle dropping materials
|
|
|
|
|
if (dropEvent->mimeData()->hasFormat(Constants::MIME_TYPE_MATERIAL)) {
|
|
|
|
|
QByteArray data = dropEvent->mimeData()->data(Constants::MIME_TYPE_MATERIAL);
|
|
|
|
|
QDataStream stream(data);
|
|
|
|
|
qint32 internalId;
|
|
|
|
|
stream >> internalId;
|
|
|
|
|
ModelNode matNode = m_view->modelNodeForInternalId(internalId);
|
|
|
|
|
|
|
|
|
|
if (matNode.isValid())
|
|
|
|
|
m_view->dropMaterial(matNode, dropEvent->position());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// handle dropping external assets
|
2021-09-30 13:42:48 +03:00
|
|
|
const DesignerActionManager &actionManager = QmlDesignerPlugin::instance()
|
|
|
|
|
->viewManager().designerActionManager();
|
2021-10-06 11:10:36 +03:00
|
|
|
QHash<QString, QStringList> addedAssets = actionManager.handleExternalAssetsDrop(dropEvent->mimeData());
|
|
|
|
|
|
2021-10-26 18:07:45 +03:00
|
|
|
view()->executeInTransaction("Edit3DWidget::dropEvent", [&] {
|
|
|
|
|
// add 3D assets to 3d editor (QtQuick3D import will be added if missing)
|
|
|
|
|
ItemLibraryInfo *itemLibInfo = m_view->model()->metaInfo().itemLibraryInfo();
|
|
|
|
|
|
|
|
|
|
const QStringList added3DAssets = addedAssets.value(ComponentCoreConstants::add3DAssetsDisplayString);
|
|
|
|
|
for (const QString &assetPath : added3DAssets) {
|
|
|
|
|
QString fileName = QFileInfo(assetPath).baseName();
|
|
|
|
|
fileName = fileName.at(0).toUpper() + fileName.mid(1); // capitalize first letter
|
|
|
|
|
QString type = QString("Quick3DAssets.%1.%1").arg(fileName);
|
|
|
|
|
QList<ItemLibraryEntry> entriesForType = itemLibInfo->entriesForType(type.toLatin1());
|
|
|
|
|
if (!entriesForType.isEmpty()) { // should always be true, but just in case
|
|
|
|
|
QmlVisualNode::createQml3DNode(view(), entriesForType.at(0),
|
|
|
|
|
m_canvas->activeScene(), {}, false).modelNode();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
2020-02-11 11:33:25 +02:00
|
|
|
}
|
2021-09-30 13:42:48 +03:00
|
|
|
|
|
|
|
|
} // namespace QmlDesigner
|