Changeset 2f55df6 in sasview for src/sas/qtgui/Plotting


Ignore:
Timestamp:
Sep 27, 2018 6:13:13 AM (6 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
51b9c14
Parents:
b38871e
git-author:
Piotr Rozyczko <piotr.rozyczko@…> (09/27/18 06:11:38)
git-committer:
Piotr Rozyczko <piotr.rozyczko@…> (09/27/18 06:13:13)
Message:

Slicer Parameters should also close the corresponding subwindow on exit.
Also: fixed toFloat() conversion.
SASVIEW-1115

Location:
src/sas/qtgui/Plotting
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Plotting/Plotter2D.py

    r63467b6 r2f55df6  
    229229        def slicer_closed(): 
    230230            # Need to disconnect the signal!! 
    231             self.slicer_widget.close_signal.disconnect() 
     231            self.slicer_widget.closeWidgetSignal.disconnect() 
     232            self.manager.parent.workspace().removeSubWindow(self.slicer_subwindow) 
    232233            # reset slicer_widget on "Edit Slicer Parameters" window close 
    233234            self.slicer_widget = None 
     
    237238        self.slicer_widget = SlicerParameters(model=self.param_model, 
    238239                                              validate_method=self.slicer.validate) 
    239         self.slicer_widget.close_signal.connect(slicer_closed) 
     240        self.slicer_widget.closeWidgetSignal.connect(slicer_closed) 
    240241        # Add the plot to the workspace 
    241         self.manager.parent.workspace().addSubWindow(self.slicer_widget) 
     242        self.slicer_subwindow = self.manager.parent.workspace().addSubWindow(self.slicer_widget) 
    242243 
    243244        self.slicer_widget.show() 
  • src/sas/qtgui/Plotting/SlicerParameters.py

    ree22241 r2f55df6  
    2020    passed from a slicer instance. 
    2121    """ 
    22     close_signal = QtCore.pyqtSignal() 
     22    closeWidgetSignal = QtCore.pyqtSignal() 
    2323    def __init__(self, model=None, validate_method=None): 
    2424        super(SlicerParameters, self).__init__() 
     
    7979        signal to the parent. 
    8080        """ 
    81         self.close_signal.emit() 
     81        self.closeWidgetSignal.emit() 
    8282        if event: 
    8383            event.accept() 
     
    163163 
    164164        # Find out the changed parameter name and proposed value 
    165         new_value = self.editor.text().toFloat()[0] 
    166         param_name = str(model.sourceModel().item(index.row(),0).text()) 
     165        new_value = GuiUtils.toDouble(self.editor.text()) 
     166        param_name = model.sourceModel().item(index.row(),0).text() 
    167167 
    168168        validated = True 
  • src/sas/qtgui/Plotting/UnitTesting/SlicerParametersTest.py

    r725d9c06 r2f55df6  
    6060 
    6161        # Set up the spy 
    62         spy_close = QtSignalSpy(self.widget, self.widget.close_signal) 
     62        spy_close = QtSignalSpy(self.widget, self.widget.closeWidgetSignal) 
    6363        # Click on the "Close" button 
    6464        QtTest.QTest.mouseClick(self.widget.buttonBox.button(QtWidgets.QDialogButtonBox.Close), QtCore.Qt.LeftButton) 
Note: See TracChangeset for help on using the changeset viewer.