From b86837b4b0b08dac826b6d819b70f085f6b43c5c Mon Sep 17 00:00:00 2001 From: Jeremy Hu Date: Sat, 23 Feb 2019 10:11:56 +0930 Subject: [PATCH] Add shortcut 'W' for toggling wireframe. --- src/documentwindow.cpp | 4 ++++ src/shortcuts.cpp | 1 + src/skeletongraphicswidget.h | 1 + 3 files changed, 6 insertions(+) diff --git a/src/documentwindow.cpp b/src/documentwindow.cpp index 94f45fab..2364c724 100644 --- a/src/documentwindow.cpp +++ b/src/documentwindow.cpp @@ -723,6 +723,10 @@ DocumentWindow::DocumentWindow() : }); connect(m_document, &Document::editModeChanged, graphicsWidget, &SkeletonGraphicsWidget::editModeChanged); + + connect(graphicsWidget, &SkeletonGraphicsWidget::shortcutToggleWireframe, [=]() { + m_modelRenderWidget->toggleWireframe(); + }); connect(graphicsWidget, &SkeletonGraphicsWidget::zoomRenderedModelBy, m_modelRenderWidget, &ModelWidget::zoom); diff --git a/src/shortcuts.cpp b/src/shortcuts.cpp index c1889f8b..c3806023 100644 --- a/src/shortcuts.cpp +++ b/src/shortcuts.cpp @@ -45,4 +45,5 @@ void initShortCuts(QWidget *widget, SkeletonGraphicsWidget *graphicsWidget) defineKey(Qt::Key_M, &SkeletonGraphicsWidget::shortcutXmirrorOnOrOffSelectedPart); defineKey(Qt::Key_B, &SkeletonGraphicsWidget::shortcutSubdivedOrNotSelectedPart); defineKey(Qt::Key_U, &SkeletonGraphicsWidget::shortcutRoundEndOrNotSelectedPart); + defineKey(Qt::Key_W, &SkeletonGraphicsWidget::shortcutToggleWireframe); } diff --git a/src/skeletongraphicswidget.h b/src/skeletongraphicswidget.h index 948a608b..82ae4788 100644 --- a/src/skeletongraphicswidget.h +++ b/src/skeletongraphicswidget.h @@ -385,6 +385,7 @@ signals: void switchChainSide(std::set nodeIds); void enableAllPositionRelatedLocks(); void disableAllPositionRelatedLocks(); + void shortcutToggleWireframe(); public: SkeletonGraphicsWidget(const SkeletonDocument *document); std::map> nodeItemMap;