summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Leinonen <tony.leinonen@qt.io>2020-10-26 11:33:51 +0200
committerTony Leinonen <tony.leinonen@qt.io>2020-10-26 12:19:37 +0200
commit9d841f09662603b0288bf866fb5a4324bbbea1f4 (patch)
treef4c70e4b1282dd8324d698d8b519a899b7b73001
parente77e7151bd631c3470296b67f67a8cee34b68ab8 (diff)
Filter action event list for signal objectsv2.8.0
Signals can only use onactivate and deactivate events so filter everything else out from the list. Task-number: QT3DS-4198 Change-Id: I46587b76e54ce4d0ecf3f8d532258080ea11870a Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r--src/Authoring/Qt3DStudio/Palettes/Action/ActionView.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Authoring/Qt3DStudio/Palettes/Action/ActionView.cpp b/src/Authoring/Qt3DStudio/Palettes/Action/ActionView.cpp
index cd4c4fb6..1c4fe0f2 100644
--- a/src/Authoring/Qt3DStudio/Palettes/Action/ActionView.cpp
+++ b/src/Authoring/Qt3DStudio/Palettes/Action/ActionView.cpp
@@ -533,6 +533,22 @@ QObject *ActionView::showEventBrowser(const QPoint &point)
qt3dsdm::TEventHandleList eventList;
bridge->GetEvents(instanceHandle, eventList);
+
+ // Only show time events if the selected object is a signal
+ auto info = m_objRefHelper->GetInfo(m_itemHandle);
+ if (info.m_Type == OBJTYPE_SIGNAL) {
+ qt3dsdm::TEventHandleList filteredEventList;
+ auto thePos = eventList.begin();
+ for (; thePos != eventList.end(); ++thePos) {
+ qt3dsdm::SEventInfo theEvent = bridge->GetEventInfo(*thePos);
+ QString name = QString::fromWCharArray(theEvent.m_Category.wide_str());
+
+ if (name == QString("Time"))
+ filteredEventList.emplace_back(*thePos);
+ }
+ eventList = filteredEventList;
+ }
+
m_eventsModel->setEventList(eventList);
if (!m_eventsBrowser)