From: vsv Date: Thu, 10 Oct 2019 08:13:44 +0000 (+0300) Subject: Use Enable/Disable instead of show/hide for button X-Git-Tag: V9_5_0a1~167^2~90 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0804cc1171dfe6430912eed8256a52a0bba8041e;p=modules%2Fshaper.git Use Enable/Disable instead of show/hide for button --- diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index 1f969d0eb..1b65412e8 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -190,7 +190,7 @@ myIsSelection(false) myShowDOFBtn = new QPushButton(tr("Show remaining DoFs"), aSecondWgt); aLayout->addWidget(myShowDOFBtn); - myShowDOFBtn->hide(); + myShowDOFBtn->setEnabled(false); connect(myShowDOFBtn, SIGNAL(clicked(bool)), SLOT(onShowDOF())); myStackWidget->addWidget(aSecondWgt); @@ -759,18 +759,16 @@ bool PartSet_WidgetSketchLabel::restoreValueCustom() int aDoF = aVal.toInt(); if (aDoF == 0) { myDoFLabel->setText(tr("Sketch is fully fixed (DoF = 0)")); - myShowDOFBtn->hide(); + myShowDOFBtn->setEnabled(false); } else { myDoFLabel->setText(tr("DoF (degrees of freedom) = ") + aVal); - CompositeFeaturePtr aCompFeature = std::dynamic_pointer_cast(myFeature); - if (aCompFeature.get() && aCompFeature->numberOfSubs() > 1) - myShowDOFBtn->show(); + myShowDOFBtn->setEnabled(true); } } } else { myDoFLabel->setText(""); - myShowDOFBtn->hide(); + myShowDOFBtn->setEnabled(false); } } return true;