def test_font_propagation(self): cmap = CategoricalColorMap(np.array([[255] * 3, [0] * 3]), names=["a", "b"]) w = CategoricalColorLegend(cmap, title="Title") self.scene.addItem(w) font = QFont("Windings") w.setFont(font) # needs to be polished for FontChange to be delivered self.ensure_scene_polished() self.assertEqual(w.layout().itemAt(0).item.font().family(), font.family())
def assertFontEqual(self, font1: QFont, font2: QFont): self.assertEqual(font1.family(), font2.family()) self.assertEqual(font1.pointSize(), font2.pointSize()) self.assertEqual(font1.italic(), font2.italic())