demo-qt-inspector/application.py
def file_menu(self):
        """Create a file submenu with an Open File item that opens a file dialog."""
        self.file_sub_menu = self.menu_bar.addMenu('File')

        self.open_action = QAction('Open File', self)
        self.open_action.setStatusTip('Open a file into Template.')
        self.open_action.setShortcut('CTRL+O')

        self.exit_action = QAction('Exit Application', self)
        self.exit_action.setStatusTip('Exit the application.')
        self.exit_action.setShortcut('CTRL+Q')
        self.exit_action.triggered.connect(lambda: QApplication.quit())

        self.file_sub_menu.addAction(self.open_action)
        self.file_sub_menu.addAction(self.exit_action)
Create a file submenu with an Open File item that opens a file dialog.
Create a file submenu with an Open File item that opens a file dialog.
Create a file submenu with an Open File item that opens a file dialog .
def file_menu(self):
        self.file_sub_menu = self.menu_bar.addMenu('File')
        self.open_action = QAction('Open File', self)
        self.open_action.setStatusTip('Open a file into Template.')
        self.open_action.setShortcut('CTRL+O')
        self.exit_action = QAction('Exit Application', self)
        self.exit_action.setStatusTip('Exit the application.')
        self.exit_action.setShortcut('CTRL+Q')
        self.exit_action.triggered.connect(lambda: QApplication.quit())
        self.file_sub_menu.addAction(self.open_action)
        self.file_sub_menu.addAction(self.exit_action)
def file_menu ( self ) : self . file_sub_menu = self . menu_bar . addMenu ( 'File' ) self . open_action = QAction ( 'Open File' , self ) self . open_action . setStatusTip ( 'Open a file into Template.' ) self . open_action . setShortcut ( 'CTRL+O' ) self . exit_action = QAction ( 'Exit Application' , self ) self . exit_action . setStatusTip ( 'Exit the application.' ) self . exit_action . setShortcut ( 'CTRL+Q' ) self . exit_action . triggered . connect ( lambda : QApplication . quit ( ) ) self . file_sub_menu . addAction ( self . open_action ) self . file_sub_menu . addAction ( self . exit_action )
Create a file submenu with an Open File item that opens a file dialog.
Create a file submenu with an Open File item that opens a file dialog .
"""Create a file submenu with an Open File item that opens a file dialog."""
self