PlotPyStack / guiqwt

Efficient 2D plotting Python library based on PythonQwt
https://pypi.python.org/pypi/guiqwt
Other
80 stars 20 forks source link

FitDialog: avoid adding duplicate fit params #63

Closed kolas001 closed 2 years ago

kolas001 commented 8 years ago

Hi, I encountered an issue using FitDialog from guiqwt.widget.fit. I've created a FitDialog with several FitParams but every time the dialog is called, it creates a new set of fit params widgets. Here's a screenshot after 3 calls of the FitDialog ajustement de courbes_3

To avoid this, I modified the function add_fitparam_widgets_to from guiqwt.widgets.fit module like this:

    for i, param in enumerate(fitparams):
        widgets = param.get_widgets()
        if len(widgets)==0:
            param.create_widgets(layout.parent(), refresh_callback)
            widgets = param.get_widgets()

Hope that helps, and by the way, you're doing an great job!