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()
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()
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()
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)