mirror of
https://github.com/KLayout/klayout.git
synced 2026-08-29 01:14:35 +02:00
Issue 1029 - Crash on QTreeViewItem#setBackgroundColor (#1032)
* Fixed issue #1029 The problem happened because in the described case the tl::Variant used as a intermediate container holds the Python QBrush object and when it gets deleted, the QBrush object is deleted too. * Added tests
This commit is contained in:
Vendored
+9
@@ -640,6 +640,15 @@ class QtBindingTest(unittest.TestCase):
|
||||
else:
|
||||
self.assertEqual(str(jsonData), 'b\'{"test":"test"}\'')
|
||||
|
||||
def test_54(self):
|
||||
|
||||
# issue #1029 (Crash for QBrush passed to setData)
|
||||
item = pya.QTreeWidgetItem()
|
||||
item.setBackground(0, pya.QBrush(pya.QColor(0xFF, 0xFF, 0x00)))
|
||||
self.assertEqual(item.background(0).color.red, 255)
|
||||
self.assertEqual(item.background(0).color.green, 255)
|
||||
self.assertEqual(item.background(0).color.blue, 0)
|
||||
|
||||
# run unit tests
|
||||
if __name__ == '__main__':
|
||||
suite = unittest.TestLoader().loadTestsFromTestCase(QtBindingTest)
|
||||
|
||||
Reference in New Issue
Block a user