Beispiel #1
0
 def testListModelDoesntKeepsReference(self):
     model = ListModelDoesntKeepsReference()
     view = TestView(model)
     obj = view.getData()
     self.assertEqual(type(obj), MyObject)
     self.assertEqual(obj.objectName(), object_name)
     obj.metaObject()
Beispiel #2
0
 def testDelegateKeepsReferenceToEditor(self):
     view = TestView(None)
     delegate = DelegateKeepsReferenceToEditor()
     view.setItemDelegate(delegate)
     editor = view.getEditorWidgetFromItemDelegate()
     self.assertEqual(type(editor), QComboBox)
     self.assertEqual(editor.count(), 1)
     self.assertEqual(editor.itemData(0, Qt.DisplayRole), id_text)
     editor.metaObject()
 def testDelegateKeepsReferenceToEditor(self):
     view = TestView(None)
     delegate = DelegateKeepsReferenceToEditor()
     view.setItemDelegate(delegate)
     editor = view.getEditorWidgetFromItemDelegate()
     self.assertEqual(type(editor), QComboBox)
     self.assertEqual(editor.count(), 1)
     self.assertEqual(editor.itemData(0, Qt.DisplayRole), id_text)
     editor.metaObject()
Beispiel #4
0
 def testListModelThatReturnsString(self):
     model = ListModelThatReturnsString()
     view = TestView(model)
     obj = view.getData()
     self.assertEqual(type(obj), py3k.unicode)
     self.assertEqual(obj, 'string')