From cff19f327181a1147992d1e5195839d792578b96 Mon Sep 17 00:00:00 2001 From: lidstrom83 Date: Thu, 22 Oct 2020 08:28:03 -0700 Subject: [PATCH] Hide WidgetParameterItem.defaultBtn if param has no default (#1411) Co-authored-by: Daniel Lidstrom --- pyqtgraph/parametertree/parameterTypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyqtgraph/parametertree/parameterTypes.py b/pyqtgraph/parametertree/parameterTypes.py index a126793c..19d4f213 100644 --- a/pyqtgraph/parametertree/parameterTypes.py +++ b/pyqtgraph/parametertree/parameterTypes.py @@ -186,7 +186,7 @@ class WidgetParameterItem(ParameterItem): self.defaultBtn.setEnabled(not self.param.valueIsDefault() and self.param.writable()) # hide / show - self.defaultBtn.setVisible(not self.param.readonly()) + self.defaultBtn.setVisible(self.param.hasDefault() and not self.param.readonly()) def updateDisplayLabel(self, value=None): """Update the display label to reflect the value of the parameter."""