I have a main window with some buttons and a plot. I added a file menu, using Qt Designer. Now, if I run my app, everything is good and I can see a typical menu bar. The problem is, I want to click on the menu bar and perform an action - I want to open an internet web page with the default browser. Can someone help me?
This is the code generated with pyuic4 from Qt Designer (I show just the code for the file menu):
self.menubar = QtGui.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 1445, 21))
self.menubar.setObjectName(_fromUtf8("menubar"))
self.menuFile = QtGui.QMenu(self.menubar)
self.menuFile.setObjectName(_fromUtf8("menuFile"))
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtGui.QStatusBar(MainWindow)
self.statusbar.setObjectName(_fromUtf8("statusbar"))
MainWindow.setStatusBar(self.statusbar)
self.actionFsa_format = QtGui.QAction(MainWindow)
self.actionFsa_format.setObjectName(_fromUtf8("actionFsa_format"))
self.menuFile.addAction(self.actionFsa_format)
self.menubar.addAction(self.menuFile.menuAction())
As you can see I have a file menu, and a tool-button with an actionFsa_format action. I want to click this and open an external url.