3 examples of 'pyqt5 drop down menu' in Python

Every line of 'pyqt5 drop down menu' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
46def _setup_popup_menu(self):
47 self.popupmenu = gtk.Menu()
48 self._setup_about()
49 self._setup_prefs_widget()
50 self._setup_select_area()
51 self._setup_quit()
258def move_down(menu, index):
259 menu['index'] = find_item_after(menu, index=index)
260
261 if menu['on_move']:
262 _entry = get_selected_item(MENUS.index(menu), menu['index'])
263 return menu['on_move'](_entry)
4def build_menu(window, parent_menu, menu_defs):
5 for name, action, shortcut in menu_defs:
6 if name is None:
7 parent_menu.addSeparator()
8 elif isinstance(action, list):
9 m = parent_menu.addMenu(name)
10 build_menu(window, m, action)
11 else:
12 a = QtWidgets.QAction(name, window)
13 if shortcut:
14 a.setShortcut(shortcut)
15 if callable(action):
16 a.triggered.connect(action)
17 else:
18 print(f'Warning: menu item {name}: {action} is not callable.')
19 parent_menu.addAction((a))

Related snippets