From cd963fa87d2e183e83fe48c05b6ca547108a9e54 Mon Sep 17 00:00:00 2001 From: Jeremy HU Date: Wed, 16 Nov 2022 22:54:09 +1100 Subject: [PATCH] Fix double click to select all --- application/sources/skeleton_graphics_widget.cc | 8 +++++++- application/sources/skeleton_graphics_widget.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/application/sources/skeleton_graphics_widget.cc b/application/sources/skeleton_graphics_widget.cc index 77fd41bd..fb051463 100644 --- a/application/sources/skeleton_graphics_widget.cc +++ b/application/sources/skeleton_graphics_widget.cc @@ -1485,6 +1485,11 @@ bool SkeletonGraphicsWidget::mousePress(QMouseEvent* event) if (processed) { return true; } + } else if (Document::EditMode::Pick == m_document->editMode) { + if (m_hoveredNodeItem) { + dust3dDebug << "nodePicked:" << m_hoveredNodeItem->id().toString(); + emit nodePicked(m_hoveredNodeItem->id()); + } } } @@ -1531,7 +1536,8 @@ QPointF SkeletonGraphicsWidget::scenePosFromUnified(QPointF pos) bool SkeletonGraphicsWidget::mouseDoubleClick(QMouseEvent* event) { if (m_hoveredNodeItem || m_hoveredEdgeItem) { - selectPartAll(); + if (Document::EditMode::Select == m_document->editMode) + selectPartAll(); return true; } if (QGuiApplication::queryKeyboardModifiers().testFlag(Qt::ControlModifier)) { diff --git a/application/sources/skeleton_graphics_widget.h b/application/sources/skeleton_graphics_widget.h index 38c95aba..7cba9c06 100644 --- a/application/sources/skeleton_graphics_widget.h +++ b/application/sources/skeleton_graphics_widget.h @@ -76,6 +76,7 @@ signals: void shortcutToggleFlatShading(); void shortcutToggleRotation(); void loadedTurnaroundImageChanged(); + void nodePicked(const dust3d::Uuid& nodeId); public: SkeletonGraphicsWidget(const Document* document);