Exemplo n.º 1
0
    def testGUIEdition(self):
        """Make sure the colormap is correctly edited and also that the
        modification are correctly updated if an other colormapdialog is
        editing the same colormap"""
        colormapDiag2 = ColormapDialog.ColormapDialog()
        colormapDiag2.setColormap(self.colormap)
        colormapDiag2.show()
        self.colormapDiag.setColormap(self.colormap)
        self.colormapDiag.show()
        self.qapp.processEvents()

        self.colormapDiag._comboBoxColormap._setCurrentName('red')
        self.colormapDiag._normButtonLog.click()
        self.assertTrue(self.colormap.getName() == 'red')
        self.assertTrue(self.colormapDiag.getColormap().getName() == 'red')
        self.assertTrue(self.colormap.getNormalization() == 'log')
        self.assertTrue(self.colormap.getVMin() == 10)
        self.assertTrue(self.colormap.getVMax() == 20)
        # checked second colormap dialog
        self.assertTrue(
            colormapDiag2._comboBoxColormap.getCurrentName() == 'red')
        self.assertTrue(colormapDiag2._normButtonLog.isChecked())
        self.assertTrue(int(colormapDiag2._minValue.getValue()) == 10)
        self.assertTrue(int(colormapDiag2._maxValue.getValue()) == 20)
        colormapDiag2.close()
Exemplo n.º 2
0
    def setUp(self):
        TestCaseQt.setUp(self)
        ParametricTestCase.setUp(self)
        self.colormap = Colormap(name='gray', vmin=10.0, vmax=20.0,
                                 normalization='linear')

        self.colormapDiag = ColormapDialog.ColormapDialog()
Exemplo n.º 3
0
def colormapDialog(qapp, qapp_utils):
    dialog = ColormapDialog.ColormapDialog()
    dialog.setAttribute(qt.Qt.WA_DeleteOnClose)
    yield weakref.proxy(dialog)
    qapp.processEvents()
    from silx.gui.qt import inspect
    if inspect.isValid(dialog):
        dialog.close()
        qapp.processEvents()
Exemplo n.º 4
0
    def setUp(self):
        TestCaseQt.setUp(self)
        ParametricTestCase.setUp(self)
        self.colormap = Colormap(name='gray',
                                 vmin=10.0,
                                 vmax=20.0,
                                 normalization='linear')

        self.colormapDiag = ColormapDialog.ColormapDialog()
        self.colormapDiag.setAttribute(qt.Qt.WA_DeleteOnClose)