コード例 #1
0
ファイル: test_colormapdialog.py プロジェクト: jackal02/silx
    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()
コード例 #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()
コード例 #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()
コード例 #4
0
ファイル: test_colormapdialog.py プロジェクト: fejat/silx
    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)