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