MCPcopy Create free account
hub / github.com/KLayout/klayout / test_55

Method test_55

testdata/python/qtbinding.py:652–675  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

650 self.assertEqual(item.background(0).color.blue, 0)
651
652 def test_55(self):
653
654 # addWidget to QHBoxLayout keeps object managed
655 window = pya.QDialog()
656 layout = pya.QHBoxLayout(window)
657
658 w = pya.QPushButton()
659 oid = str(w)
660 layout.addWidget(w)
661 self.assertEqual(str(layout.itemAt(0).widget()), oid)
662
663 # try to kill the object
664 w = None
665
666 # still there
667 w = layout.itemAt(0).widget()
668 self.assertEqual(w._destroyed(), False)
669 self.assertEqual(str(w), oid)
670
671 # killing the window kills the layout kills the widget
672 window._destroy()
673 self.assertEqual(window._destroyed(), True)
674 self.assertEqual(layout._destroyed(), True)
675 self.assertEqual(w._destroyed(), True)
676
677 def test_56(self):
678

Callers

nothing calls this directly

Calls 3

strFunction · 0.85
widgetMethod · 0.45
itemAtMethod · 0.45

Tested by

no test coverage detected