summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp96
-rw-r--r--src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp3
2 files changed, 52 insertions, 47 deletions
diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp
index 7eb66f61..ac537671 100644
--- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp
+++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp
@@ -1000,54 +1000,56 @@ void TimelineGraphicsScene::updateHoverStatus(const QPointF &scenePos)
RowTree *rowTree = item->type() == TimelineItem::TypeRowTree
? static_cast<RowTree *>(item)
: static_cast<RowTreeLabelItem *>(item)->parentRow();
- int left = rowTree->clipX();
- int right = (int)rowTree->treeWidth() - TimelineConstants::TREE_ICONS_W;
- variantsAreaHovered = scenePos.x() > left && scenePos.x() < right;
- if (variantsAreaHovered && rowTree != m_variantsRowTree) {
- CDoc *doc = g_StudioApp.GetCore()->GetDoc();
- const auto propertySystem = doc->GetStudioSystem()->GetPropertySystem();
- const auto bridge = doc->GetStudioSystem()->GetClientDataModelBridge();
- auto property = bridge->GetLayer().m_variants;
-
- using namespace qt3dsdm;
- SValue sValue;
- if (propertySystem->GetInstancePropertyValue(rowTree->instance(), property,
- sValue)) {
- QString propVal = qt3dsdm::get<qt3dsdm::TDataStrPtr>(sValue)->toQString();
- if (!propVal.isEmpty()) {
- // parse propVal into variantsHash (group => tags)
- const QStringList tagPairs = propVal.split(QLatin1Char(','));
- QHash<QString, QStringList> variantsHash;
- QStringList variantsHashKeys; // maintain traverse order
- for (auto &tagPair : tagPairs) {
- const QStringList pair = tagPair.split(QLatin1Char(':'));
- variantsHash[pair[0]].append(pair[1]);
- if (!variantsHashKeys.contains(pair[0]))
- variantsHashKeys.append(pair[0]);
- }
-
- // parse variantsHash into tooltipStr
- const auto variantsDef
- = g_StudioApp.GetCore()->getProjectFile().variantsDef();
- QString templ = QStringLiteral("<font color='%1'>%2</font>");
- QString tooltipStr("<table>");
- for (auto &g : qAsConst(variantsHashKeys)) {
- tooltipStr.append("<tr><td>");
- tooltipStr.append(templ.arg(variantsDef[g].m_color).arg(g + ": "));
- tooltipStr.append("</td><td>");
- for (auto &t : qAsConst(variantsHash[g]))
- tooltipStr.append(t + ", ");
- tooltipStr.chop(2);
- tooltipStr.append("</td></tr>");
+ if (!rowTree->isProperty()) {
+ int left = rowTree->clipX();
+ int right = (int)rowTree->treeWidth() - TimelineConstants::TREE_ICONS_W;
+ variantsAreaHovered = scenePos.x() > left && scenePos.x() < right;
+ if (variantsAreaHovered && rowTree != m_variantsRowTree) {
+ CDoc *doc = g_StudioApp.GetCore()->GetDoc();
+ const auto propertySystem = doc->GetStudioSystem()->GetPropertySystem();
+ const auto bridge = doc->GetStudioSystem()->GetClientDataModelBridge();
+ auto property = bridge->GetLayer().m_variants;
+
+ using namespace qt3dsdm;
+ SValue sValue;
+ if (propertySystem->GetInstancePropertyValue(rowTree->instance(), property,
+ sValue)) {
+ QString propVal = qt3dsdm::get<qt3dsdm::TDataStrPtr>(sValue)->toQString();
+ if (!propVal.isEmpty()) {
+ // parse propVal into variantsHash (group => tags)
+ const QStringList tagPairs = propVal.split(QLatin1Char(','));
+ QHash<QString, QStringList> variantsHash;
+ QStringList variantsHashKeys; // maintain traverse order
+ for (auto &tagPair : tagPairs) {
+ const QStringList pair = tagPair.split(QLatin1Char(':'));
+ variantsHash[pair[0]].append(pair[1]);
+ if (!variantsHashKeys.contains(pair[0]))
+ variantsHashKeys.append(pair[0]);
+ }
+
+ // parse variantsHash into tooltipStr
+ const auto variantsDef
+ = g_StudioApp.GetCore()->getProjectFile().variantsDef();
+ QString templ = QStringLiteral("<font color='%1'>%2</font>");
+ QString tooltipStr("<table>");
+ for (auto &g : qAsConst(variantsHashKeys)) {
+ tooltipStr.append("<tr><td>");
+ tooltipStr.append(templ.arg(variantsDef[g].m_color).arg(g + ": "));
+ tooltipStr.append("</td><td>");
+ for (auto &t : qAsConst(variantsHash[g]))
+ tooltipStr.append(t + ", ");
+ tooltipStr.chop(2);
+ tooltipStr.append("</td></tr>");
+ }
+ tooltipStr.append("</table>");
+ m_variantsToolTip->setText(tooltipStr);
+ m_variantsToolTip->adjustSize();
+ m_variantsToolTip->move(m_widgetTimeline->mapToGlobal(
+ {right, (int)rowTree->y()}));
+ m_variantsToolTip->raise();
+ m_variantsToolTip->show();
+ m_variantsRowTree = rowTree;
}
- tooltipStr.append("</table>");
- m_variantsToolTip->setText(tooltipStr);
- m_variantsToolTip->adjustSize();
- m_variantsToolTip->move(m_widgetTimeline->mapToGlobal(
- {right, (int)rowTree->y()}));
- m_variantsToolTip->raise();
- m_variantsToolTip->show();
- m_variantsRowTree = rowTree;
}
}
}
diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp
index 8445278c..5c5f236b 100644
--- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp
+++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp
@@ -93,6 +93,9 @@ ITimelineItemBinding *RowTree::getBinding() const
// object instance handle
int RowTree::instance() const
{
+ if (m_isProperty || !m_binding)
+ return 0;
+
return static_cast<Qt3DSDMTimelineItemBinding *>(m_binding)->GetInstance();
}