Answers for "Qmenubar pyqt"

0

Qmenubar pyqt

menubar = self.menuBar() # create our menubar
file = menubar.addMenu("&File") # create a file menu
open = QAction("&Open", self) # create a QAction
open.setShortcut("Ctrl+O") # set a shortcut for it
file.addAction(open) # and add it to our menu

# create another one and add it again to our menu
save = QAction("&Save",self) 
save.setShortcut("Ctrl+S")
file.addAction(save)

# and if you want to connect your QActions to our slots you can do it like:
open.triggered.connect(lambda: self.yourfunction())
Posted by: Guest on November-28-2020

Python Answers by Framework

Browse Popular Code Answers by Language