From c82b4b4b53c95ad07c66ff65dfcdf78c82a812ce Mon Sep 17 00:00:00 2001
From: PrimozGodec
Date: Fri, 3 Nov 2023 11:58:42 +0100
Subject: [PATCH] Topic Modelling - Do not recompute when spin value doesn't
change
---
orangecontrib/text/widgets/owtopicmodeling.py | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/orangecontrib/text/widgets/owtopicmodeling.py b/orangecontrib/text/widgets/owtopicmodeling.py
index bc15e7dc3..7f0b63df3 100644
--- a/orangecontrib/text/widgets/owtopicmodeling.py
+++ b/orangecontrib/text/widgets/owtopicmodeling.py
@@ -37,11 +37,21 @@ def __init__(self, master, **kwargs):
self.model = self.create_model()
QVBoxLayout(self)
for parameter, description, minv, maxv, step, _type in self.parameters:
- spin = gui.spin(self, self, parameter, minv=minv, maxv=maxv, step=step,
- label=self.spin_format.format(description=description, parameter=parameter),
- labelWidth=220, spinType=_type)
+ spin = gui.spin(
+ self,
+ self,
+ parameter,
+ minv=minv,
+ maxv=maxv,
+ step=step,
+ label=self.spin_format.format(
+ description=description, parameter=parameter
+ ),
+ labelWidth=220,
+ spinType=_type,
+ callback=self.on_change,
+ )
spin.clearFocus()
- spin.editingFinished.connect(self.on_change)
def on_change(self):
self.model = self.create_model()