From 156333d6ed445c784552815acc68e5cbd1be02c8 Mon Sep 17 00:00:00 2001 From: vsv Date: Tue, 8 Oct 2019 14:17:52 +0300 Subject: [PATCH] Task #2997: Add button "Show DOF" --- src/PartSet/PartSet_WidgetSketchLabel.cpp | 16 ++++++++++++++++ src/PartSet/PartSet_WidgetSketchLabel.h | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index ae937d345..2d9fd7d4f 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -182,9 +182,16 @@ myIsSelection(false) connect(aPlaneBtn, SIGNAL(clicked(bool)), SLOT(onChangePlane())); aLayout->addWidget(aPlaneBtn); + aLayout->addSpacing(15); + myDoFLabel = new QLabel("", aSecondWgt); aLayout->addWidget(myDoFLabel); + myShowDOFBtn = new QPushButton(tr("Show remaining DoFs"), aSecondWgt); + aLayout->addWidget(myShowDOFBtn); + myShowDOFBtn->hide(); + connect(myShowDOFBtn, SIGNAL(clicked(bool)), SLOT(onShowDOF())); + myStackWidget->addWidget(aSecondWgt); //setLayout(aLayout); @@ -751,14 +758,23 @@ bool PartSet_WidgetSketchLabel::restoreValueCustom() int aDoF = aVal.toInt(); if (aDoF == 0) { myDoFLabel->setText(tr("Sketch is fully fixed (DoF = 0)")); + myShowDOFBtn->hide(); } else { myDoFLabel->setText(tr("DoF (degrees of freedom) = ") + aVal); + myShowDOFBtn->show(); } } } else { myDoFLabel->setText(""); + myShowDOFBtn->hide(); } } return true; } + + +void PartSet_WidgetSketchLabel::onShowDOF() +{ + +} \ No newline at end of file diff --git a/src/PartSet/PartSet_WidgetSketchLabel.h b/src/PartSet/PartSet_WidgetSketchLabel.h index fe9c14716..0e19d7470 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.h +++ b/src/PartSet/PartSet_WidgetSketchLabel.h @@ -41,6 +41,7 @@ class XGUI_Workshop; class QCheckBox; class QStackedWidget; class QLineEdit; +class QPushButton; /** * \ingroup Modules @@ -203,6 +204,8 @@ private slots: void onChangePlane(); + void onShowDOF(); + private: /// Set sketch plane by shape /// \param theShape a planar face @@ -235,6 +238,7 @@ private: QStackedWidget* myStackWidget; QLabel* myDoFLabel; + QPushButton* myShowDOFBtn; bool myOpenTransaction; bool myIsSelection; -- 2.39.2