コード例 #1
0
    def test(self):
        """Test functions of silx.gui.qt.inspect module"""
        self.assertIsNotNone(qt_inspect)

        parent = qt.QObject()

        self.assertTrue(qt_inspect.isValid(parent))
        self.assertTrue(qt_inspect.createdByPython(parent))
        self.assertTrue(qt_inspect.ownedByPython(parent))

        obj = qt.QObject(parent)

        self.assertTrue(qt_inspect.isValid(obj))
        self.assertTrue(qt_inspect.createdByPython(obj))
        self.assertFalse(qt_inspect.ownedByPython(obj))

        del parent
        self.assertFalse(qt_inspect.isValid(obj))
コード例 #2
0
ファイル: test.py プロジェクト: t20100/silx
 def testOneObject(self):
     """Test blockSignals context manager with a single QObject"""
     self._test(qt.QObject())
コード例 #3
0
ファイル: test.py プロジェクト: t20100/silx
 def testManyObjects(self):
     """Test blockSignals with 2 QObjects"""
     self._test(qt.QObject(), qt.QObject())
コード例 #4
0
ファイル: test_qt.py プロジェクト: WuZifan/silx
 def testQObject(self):
     """Test that QObject is there."""
     obj = qt.QObject()
     self.assertTrue(obj is not None)