I am having issues getting Qt.QTest.mouseClick() working in some tests I wrote. This test fails:

def testFixBug(self):
       # Trying to figure out why my mouse click isn't being recognized.
       checkBox = QtGui.QCheckBox(self.view)
       self.assertEqual(checkBox.checkState(), QtCore.Qt.Unchecked)
       Qt.QTest.mouseClick(checkBox, QtCore.Qt.LeftButton)
       self.assertEqual(checkBox.checkState(), QtCore.Qt.Checked)


However, changing "Qt.QTest.mouseClick(checkBox, QtCore.Qt.LeftButton)" to "checkBox.click()" works. I'm confused because I know I've used the Qt.QTest.mouseClick() method in other tests in the past and it worked. That was a while ago and perhaps I'm doing something differently now or I forgot some important caveat. Anyone have any suggestions on why Qt.QTest.mouseClick() might not work? Thanks.
-Brent
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to