summaryrefslogtreecommitdiffstats
path: root/src/Authoring/Qt3DStudio/DragAndDrop/BasicObjectDropSource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Authoring/Qt3DStudio/DragAndDrop/BasicObjectDropSource.cpp')
-rw-r--r--src/Authoring/Qt3DStudio/DragAndDrop/BasicObjectDropSource.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/Authoring/Qt3DStudio/DragAndDrop/BasicObjectDropSource.cpp b/src/Authoring/Qt3DStudio/DragAndDrop/BasicObjectDropSource.cpp
index d99bd9a5..ecaae33a 100644
--- a/src/Authoring/Qt3DStudio/DragAndDrop/BasicObjectDropSource.cpp
+++ b/src/Authoring/Qt3DStudio/DragAndDrop/BasicObjectDropSource.cpp
@@ -163,6 +163,9 @@ CCmd *CBasicObjectDropSource::GenerateAssetCommand(qt3dsdm::Qt3DSDMInstanceHandl
case OBJTYPE_GROUP:
theComposerType = ComposerObjectTypes::Group;
break;
+ case OBJTYPE_SIGNAL:
+ theComposerType = ComposerObjectTypes::Signal;
+ break;
case OBJTYPE_IMAGE:
theComposerType = ComposerObjectTypes::Image;
break;
@@ -254,10 +257,17 @@ CCmd *CBasicObjectDropSource::GenerateAssetCommand(qt3dsdm::Qt3DSDMInstanceHandl
Q3DStudio::ImportUtils::GetInsertTypeForDropType(inDestType), thePoint,
theStartTime);
} else {
- SCOPED_DOCUMENT_EDITOR(*theDoc, QObject::tr("Add Instance"))
- ->CreateSceneGraphInstance(theComposerType, inTarget, inSlide, theInsertType,
+ ScopedDocumentEditor editor(
+ SCOPED_DOCUMENT_EDITOR(*theDoc, QObject::tr("Add Instance")));
+ Qt3DSDMInstanceHandle newHandle =
+ editor->CreateSceneGraphInstance(theComposerType, inTarget, inSlide, theInsertType,
thePoint, (EPrimitiveType)m_PrimitiveType, theStartTime,
false);
+
+ if (theComposerType == ComposerObjectTypes::Signal) {
+ // When creating a signal, automatically create also onActivate action
+ editor->AddAction(inSlide, newHandle, L"onActivate", L"Emit Signal");
+ }
}
}
return nullptr;