Exemple #1
0
 def test_center_changed(self):
     w = ColorGradientSelection(center=42)
     changed = QSignalSpy(w.centerChanged)
     w.center_edit.setText("41")
     w.center_edit.editingFinished.emit()
     self.assertEqual(w.center(), 41)
     self.assertEqual(list(changed), [[41]])
Exemple #2
0
 def test_center_changed(self):
     w = ColorGradientSelection(center=42)
     changed = QSignalSpy(w.centerChanged)
     ledit = w.center_edit.lineEdit()
     ledit.selectAll()
     QTest.keyClicks(ledit, "41")
     QTest.keyClick(ledit, Qt.Key_Return)
     self.assertEqual(w.center(), 41.0)
     self.assertEqual(list(changed), [[41.0]])
Exemple #3
0
 def test_center(self):
     w = ColorGradientSelection(center=42)
     self.assertEqual(w.center(), 42)
     w.setCenter(40)
     self.assertEqual(w.center(), 40)