Ejemplo n.º 1
0
 def createEditor(self, parent, option, index):
     col = index.column()
     if col == TableModelLines._COL_COLOR:
         # Color handled by doubleClicked SIGNAL
         pass
     # LineWidth or Marker size or Alpha
     elif (col == TableModelLines._COL_LINEWIDTH
           or col == TableModelLines._COL_ALPHA
           or col == TableModelLines._COL_MARKERSIZE):
         spinBoxSize = _QDoubleSpinBox(parent)
         spinBoxSize.setMinimum(0)
         spinBoxSize.setMaximum(20)
         spinBoxSize.setSingleStep(.5)
         return spinBoxSize
     elif col == TableModelLines._COL_LINESTYLE:  # LineStyle
         comboBoxLineStyle = _QComboBox(parent)
         for line_style in MplLines.LINESTYLE_DESC:
             comboBoxLineStyle.addItem(line_style)
         return comboBoxLineStyle
     elif col == TableModelLines._COL_MARKER:  # Marker
         comboBoxMarker = _QComboBox(parent)
         for marker_style in MplMarkers.MARKER_DESC:
             comboBoxMarker.addItem(marker_style)
         return comboBoxMarker
     elif col == TableModelLines._COL_LABEL:  # Label
         lineEditLabel = _QLineEdit(parent)
         return lineEditLabel
     elif col == TableModelLines._COL_DELETE:  # Delete?
         pass
     else:
         return _QVariant()
Ejemplo n.º 2
0
 def createEditor(self, parent, option, index):
         col = index.column()
         if col == TableModelLines._COL_COLOR:
             # Color handled by doubleClicked SIGNAL
             pass
         # LineWidth or Marker size or Alpha
         elif (col == TableModelLines._COL_LINEWIDTH or
               col == TableModelLines._COL_ALPHA or
               col == TableModelLines._COL_MARKERSIZE):
             spinBoxSize = _QDoubleSpinBox(parent)
             spinBoxSize.setMinimum(0)
             spinBoxSize.setMaximum(20)
             spinBoxSize.setSingleStep(.5)
             return spinBoxSize
         elif col == TableModelLines._COL_LINESTYLE:  # LineStyle
             comboBoxLineStyle = _QComboBox(parent)
             for line_style in MplLines.LINESTYLE_DESC:
                 comboBoxLineStyle.addItem(line_style)
             return comboBoxLineStyle
         elif col == TableModelLines._COL_MARKER:  # Marker
             comboBoxMarker = _QComboBox(parent)
             for marker_style in MplMarkers.MARKER_DESC:
                 comboBoxMarker.addItem(marker_style)
             return comboBoxMarker
         elif col == TableModelLines._COL_LABEL:  # Label
             lineEditLabel = _QLineEdit(parent)
             return lineEditLabel
         elif col == TableModelLines._COL_DELETE:  # Delete?
             pass
         else:
             return _QVariant()
Ejemplo n.º 3
0
    def createEditor(self, parent, option, index):
        col = index.column()

        if col == TableModelImages._COL_ALPHA:
            spinBoxSize = _QDoubleSpinBox(parent)
            spinBoxSize.setMinimum(0)
            spinBoxSize.setMaximum(1)
            spinBoxSize.setSingleStep(.1)
            return spinBoxSize
        # clim_low, clim_high
        elif (col == TableModelImages._COL_CLIM_LOW
              or col == TableModelImages._COL_CLIM_HIGH):
            spinBoxSize = _QDoubleSpinBox(parent)
            spinBoxSize.setMinimum(-1e10)
            spinBoxSize.setMaximum(1e10)
            spinBoxSize.setSingleStep(.5)
            return spinBoxSize
        elif col == TableModelImages._COL_CBAR:  # colorbar
            #                print('3')
            comboBoxTrueFalse = _QComboBox(parent)
            comboBoxTrueFalse.addItems(['True', 'False'])
            return comboBoxTrueFalse
        elif col == TableModelImages._COL_CMAP:  # cmaps
            comboBoxCmapNames = _QComboBox(parent)
            list_cmaps = list(_mpl.cm.cmap_d.keys())
            list_cmaps.sort()
            for cmap_name in list_cmaps:
                comboBoxCmapNames.addItem(cmap_name)
            return comboBoxCmapNames
        elif col == TableModelImages._COL_LABEL:  # Label
            lineEditLabel = _QLineEdit(parent)
            return lineEditLabel
        elif col == TableModelImages._COL_DELETE:  # Delete?
            pass
        else:
            return _QVariant()
Ejemplo n.º 4
0
    def createEditor(self, parent, option, index):
            col = index.column()

            if col == TableModelImages._COL_ALPHA:
                spinBoxSize = _QDoubleSpinBox(parent)
                spinBoxSize.setMinimum(0)
                spinBoxSize.setMaximum(1)
                spinBoxSize.setSingleStep(.1)
                return spinBoxSize
            # clim_low, clim_high
            elif (col == TableModelImages._COL_CLIM_LOW or
                  col == TableModelImages._COL_CLIM_HIGH):
                spinBoxSize = _QDoubleSpinBox(parent)
                spinBoxSize.setMinimum(-1e10)
                spinBoxSize.setMaximum(1e10)
                spinBoxSize.setSingleStep(.5)
                return spinBoxSize
            elif col == TableModelImages._COL_CBAR:  # colorbar
#                print('3')
                comboBoxTrueFalse = _QComboBox(parent)
                comboBoxTrueFalse.addItems(['True','False'])
                return comboBoxTrueFalse
            elif col == TableModelImages._COL_CMAP:  # cmaps
                comboBoxCmapNames = _QComboBox(parent)
                list_cmaps = list(_mpl.cm.cmap_d.keys())
                list_cmaps.sort()
                for cmap_name in list_cmaps:
                    comboBoxCmapNames.addItem(cmap_name)
                return comboBoxCmapNames
            elif col == TableModelImages._COL_LABEL:  # Label
                lineEditLabel = _QLineEdit(parent)
                return lineEditLabel
            elif col == TableModelImages._COL_DELETE:  # Delete?
                pass
            else:
                return _QVariant()