PlotPyStack / guiqwt

Efficient 2D plotting Python library based on PythonQwt

Home Page:https://pypi.python.org/pypi/guiqwt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FitDialog: avoid adding duplicate fit params

kolas001 opened this issue · comments

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!