Changeset d6b8a1d in sasview for src/sas/qtgui/Calculators


Ignore:
Timestamp:
Nov 9, 2017 8:43:56 AM (6 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
53c771e
Parents:
fbfc488
git-author:
Piotr Rozyczko <rozyczko@…> (11/07/17 08:29:59)
git-committer:
Piotr Rozyczko <rozyczko@…> (11/09/17 08:43:56)
Message:

More Qt5 related fixes

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

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Calculators/DataOperationUtilityPanel.py

    rfbfc488 rd6b8a1d  
    5656 
    5757        # validator for coefficient 
    58         self.txtNumber.setValidator(QtGui.QDoubleValidator()) 
     58        self.txtNumber.setValidator(GuiUtils.DoubleValidator()) 
    5959 
    6060        self.layoutOutput = QtWidgets.QHBoxLayout() 
  • src/sas/qtgui/Calculators/GenericScatteringCalculator.py

    rfbfc488 rd6b8a1d  
    611611            'options': QtWidgets.QFileDialog.DontUseNativeDialog} 
    612612        # Query user for filename. 
    613         filename = str(QtWidgets.QFileDialog.getSaveFileName(**kwargs)) 
     613        filename_tuple = QtWidgets.QFileDialog.getSaveFileName(**kwargs) 
     614        filename = name_tuple[0] 
    614615        if filename: 
    615616            try: 
    616                 if os.path.splitext(filename)[1].lower() == '.sld': 
    617                     sas_gen.SLDReader().write(filename, self.sld_data) 
    618                 else: 
    619                     sas_gen.SLDReader().write('.'.join((filename, 'sld')), 
    620                                               self.sld_data) 
     617                _, extension = os.path.splitext(filename) 
     618                if not extension: 
     619                    filename = '.'.join((filename, 'sld')) 
     620                sas_gen.SLDReader().write(filename, self.sld_data) 
    621621            except: 
    622622                raise 
  • src/sas/qtgui/Calculators/ResolutionCalculatorPanel.py

    rfbfc488 rd6b8a1d  
    106106 
    107107        # double validator 
    108         self.txtSource2SampleDistance.setValidator(QtGui.QDoubleValidator()) 
    109         self.txtSample2DetectorDistance.setValidator(QtGui.QDoubleValidator()) 
    110         self.txtSampleOffset.setValidator(QtGui.QDoubleValidator()) 
     108        self.txtSource2SampleDistance.setValidator(GuiUtils.DoubleValidator()) 
     109        self.txtSample2DetectorDistance.setValidator(GuiUtils.DoubleValidator()) 
     110        self.txtSampleOffset.setValidator(GuiUtils.DoubleValidator()) 
    111111 
    112112        # call compute to calculate with default values 
Note: See TracChangeset for help on using the changeset viewer.