Changeset fbfc488 in sasview for src/sas/qtgui/Plotting


Ignore:
Timestamp:
Nov 9, 2017 6:43:55 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:
d6b8a1d
Parents:
7969b9c
git-author:
Piotr Rozyczko <rozyczko@…> (11/03/17 08:58:39)
git-committer:
Piotr Rozyczko <rozyczko@…> (11/09/17 06:43:55)
Message:

More Qt5 related fixes.

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

Legend:

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

    r4992ff2 rfbfc488  
    1111 
    1212class BoxSum(QtWidgets.QDialog, Ui_BoxSumUI): 
    13     apply_signal = QtCore.pyqtSignal(tuple, str) 
    1413    def __init__(self, parent=None, model=None): 
    1514        super(BoxSum, self).__init__() 
     
    2423 
    2524        self.model = model 
    26         self.mapper = QtGui.QDataWidgetMapper() 
     25        self.mapper = QtWidgets.QDataWidgetMapper() 
    2726        self.mapper.setModel(self.model) 
    2827 
     
    3231        self.mapper.addMapping(self.txtCenterX, 2) 
    3332        self.mapper.addMapping(self.txtCenterY, 3) 
    34         self.mapper.addMapping(self.lblAvg, 4, "text") 
    35         self.mapper.addMapping(self.lblAvgErr, 5, "text") 
    36         self.mapper.addMapping(self.lblSum, 6, "text") 
    37         self.mapper.addMapping(self.lblSumErr, 7, "text") 
    38         self.mapper.addMapping(self.lblNumPoints, 8, "text") 
     33        self.mapper.addMapping(self.lblAvg, 4, b"text") 
     34        self.mapper.addMapping(self.lblAvgErr, 5, b"text") 
     35        self.mapper.addMapping(self.lblSum, 6, b"text") 
     36        self.mapper.addMapping(self.lblSumErr, 7, b"text") 
     37        self.mapper.addMapping(self.lblNumPoints, 8, b"text") 
    3938 
    4039        # Populate the widgets with data from the first column 
     
    4342        self.setFixedSize(self.minimumSizeHint()) 
    4443 
     44        # Handle the Apply button click 
     45        self.buttonBox.button(QtWidgets.QDialogButtonBox.Close).clicked.connect(self.onClose) 
     46 
     47    def onClose(self): 
     48        """ 
     49        close the window containing this panel 
     50        """ 
     51        self.close() 
     52 
  • src/sas/qtgui/Plotting/Plotter.py

    r7969b9c rfbfc488  
    163163 
    164164        # refresh canvas 
    165         self.canvas.draw() 
     165        self.canvas.draw_idle() 
    166166 
    167167    def createContextMenu(self): 
  • src/sas/qtgui/Plotting/Plotter2D.py

    r7969b9c rfbfc488  
    123123        """ 
    124124        # Toggle the scale 
    125         zmin_temp = self.zmin 
     125        zmin_temp = self.zmin if self.zmin else MIN_Z 
    126126        zmax_temp = self.zmax 
    127127        # self.scale predefined in the baseclass 
  • src/sas/qtgui/Plotting/PlotterBase.py

    r7969b9c rfbfc488  
    3434        self.manager = manager 
    3535        self.quickplot = quickplot 
     36 
     37        #plt.style.use('ggplot') 
     38        plt.style.use('seaborn-darkgrid') 
    3639 
    3740        # a figure instance to plot on 
  • src/sas/qtgui/Plotting/Slicers/BoxSum.py

    r4992ff2 rfbfc488  
    66from PyQt5 import QtGui 
    77 
    8 from sas.qtgui.Utilities.GuiUtils import formatNumber 
     8from sas.qtgui.Utilities.GuiUtils import formatNumber, toDouble 
    99 
    1010from .BaseInteractor import BaseInteractor 
     
    137137        """ 
    138138        params = {} 
    139         params["Height"] = float(self.model().item(0, 0).text()) 
    140         params["Width"] = float(self.model().item(0, 1).text()) 
    141         params["center_x"] = float(self.model().item(0, 2).text()) 
    142         params["center_y"] = float(self.model().item(0, 3).text()) 
     139        params["Height"] = toDouble(self.model().item(0, 0).text()) 
     140        params["Width"] = toDouble(self.model().item(0, 1).text()) 
     141        params["center_x"] = toDouble(self.model().item(0, 2).text()) 
     142        params["center_y"] = toDouble(self.model().item(0, 3).text()) 
    143143        self.update_model = False 
    144144        self.setParams(params) 
Note: See TracChangeset for help on using the changeset viewer.