qmenubar pyqt

Solutions on MaxInterview for qmenubar pyqt by the best coders in the world

showing results for - "qmenubar pyqt"
Cristina
16 Jan 2019
1menubar = self.menuBar() # create our menubar
2file = menubar.addMenu("&File") # create a file menu
3open = QAction("&Open", self) # create a QAction
4open.setShortcut("Ctrl+O") # set a shortcut for it
5file.addAction(open) # and add it to our menu
6
7# create another one and add it again to our menu
8save = QAction("&Save",self) 
9save.setShortcut("Ctrl+S")
10file.addAction(save)
11
12# and if you want to connect your QActions to our slots you can do it like:
13open.triggered.connect(lambda: self.yourfunction())