Beispiel #1
0
 def testToolBar(self):
     self._actionDestroyed = False
     w = QWidget()
     toolBar = QToolBar(w)
     act = toolBar.addAction("MENU")
     _ref = weakref.ref(act, self.actionDestroyed)
     act = None
     self.assertFalse(self._actionDestroyed)
     toolBar.clear()
     self.assertTrue(self._actionDestroyed)
Beispiel #2
0
 def testToolBar(self):
     self._actionDestroyed = False
     w = QWidget()
     toolBar = QToolBar(w)
     act = toolBar.addAction("MENU")
     _ref = weakref.ref(act, self.actionDestroyed)
     act = None
     self.assertFalse(self._actionDestroyed)
     toolBar.clear()
     self.assertTrue(self._actionDestroyed)
Beispiel #3
0
    def testReference(self):
        toolbar = QToolBar()

        for i in xrange(20):
            toolbar.addAction(QAction("Action %d" % i, None))

        buttons = toolbar.findChildren(QToolButton, "")
        toolbar.clear()

        for b in buttons:
            self.assertRaises(RuntimeError, b.objectName)
Beispiel #4
0
    def testReference(self):
        toolbar = QToolBar()

        for i in xrange(20):
            toolbar.addAction(QAction("Action %d" % i, None))

        buttons = toolbar.findChildren(QToolButton, "")
        toolbar.clear()

        for b in buttons:
            self.assertRaises(RuntimeError, b.objectName)