Hello, I understand with PyQt5, for some reason, I don’t create a menu ...
although a similar, in my opinion, toolbar is being created, tell the noob what the catch is!)
import sys from PyQt5.QtWidgets import QMainWindow, QTextEdit, QAction, QApplication from PyQt5.QtGui import QIcon class Example(QMainWindow): def __init__(self): super().__init__() self.initUI() def initUI(self): exitAction = QAction(QIcon('exit.png'), 'Exit', self) exitAction.setShortcut('Ctrl+Q') exitAction.setStatusTip('Exit application') exitAction.triggered.connect(self.close) self.statusBar() # ! тут ничего не происходит menubar = self.menuBar() fileMenu = menubar.addMenu('&File') fileMenu.addAction(exitAction) # ! а тут работает toolbar = self.addToolBar('Exit') toolbar.addAction(exitAction) self.setGeometry(300, 300, 350, 250) self.setWindowTitle('Main window') self.show() if __name__ == '__main__': app = QApplication(sys.argv) ex = Example() sys.exit(app.exec_())