Changeset 5eebcd6 in sasview


Ignore:
Timestamp:
Sep 26, 2018 8:23:29 AM (3 months ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_Invariant, ESS_GUI_batch_fitting, ESS_GUI_ordering
Children:
9d23e4c
Parents:
009c7a4
Message:

Close subWindow properly. SASVIEW-1115

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

Legend:

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

    rd6b8a1d r5eebcd6  
    1313 
    1414class BoxSum(QtWidgets.QDialog, Ui_BoxSumUI): 
     15    closeWidgetSignal = QtCore.pyqtSignal() 
    1516    def __init__(self, parent=None, model=None): 
    1617        super(BoxSum, self).__init__() 
     
    4445        self.setFixedSize(self.minimumSizeHint()) 
    4546 
    46         # Handle the Apply button click 
    47         self.buttonBox.button(QtWidgets.QDialogButtonBox.Close).clicked.connect(self.onClose) 
     47        # Handle the Close button click 
     48        self.buttonBox.button(QtWidgets.QDialogButtonBox.Close).clicked.connect(lambda:self.closeWidgetSignal.emit()) 
    4849 
    49     def onClose(self): 
    50         """ 
    51         close the window containing this panel 
    52         """ 
    53         self.close() 
    54  
  • src/sas/qtgui/Plotting/Plotter2D.py

    r34f13a83 r5eebcd6  
    335335        self.slicer.update() 
    336336 
     337        def boxWidgetClosed(): 
     338            # Need to disconnect the signal!! 
     339            self.boxwidget.closeWidgetSignal.disconnect() 
     340            # reset box on "Edit Slicer Parameters" window close 
     341            self.manager.parent.workspace().removeSubWindow(self.boxwidget_subwindow) 
     342            self.boxwidget = None 
     343 
    337344        # Get the BoxSumCalculator model. 
    338345        self.box_sum_model = self.slicer.model() 
     
    340347        self.boxwidget = BoxSum(self, model=self.box_sum_model) 
    341348        # Add the plot to the workspace 
    342         self.manager.parent.workspace().addSubWindow(self.boxwidget) 
     349        self.boxwidget_subwindow = self.manager.parent.workspace().addSubWindow(self.boxwidget) 
     350        self.boxwidget.closeWidgetSignal.connect(boxWidgetClosed) 
     351 
    343352        self.boxwidget.show() 
    344353 
Note: See TracChangeset for help on using the changeset viewer.