[PyQt] Functional test on an QAction with QtTest module

Sabrina Demagny sabrina.demagny at gmail.com
Wed May 30 11:14:59 BST 2007


Hi,

I try to implement test with QtTest module on my interface which
contents a menu bar and a tool bar. I implement the GUI access to the
function "new" with a QAction:
	
	self.new = QtGui.QAction(QtGui.QIcon("new.png"), self.tr("&New"),self)


I create a menu bar and a tool bar and add the QAction:

self.fileMenu = self.menuBar().addMenu(self.tr("&File"))
self.fileMenu.addAction(self.new)

fileToolBar = self.addToolBar(self.tr("File"))
fileToolBar.addAction(self.new)


Can somebody tell me how to simulate an user mouse click on QtGui.QAction ?

Thanks once again for your help.

Sabrina.


More information about the PyQt mailing list