Quick Menu (quickmenu
)¶
Quick Menu¶
A QuickMenu
widget provides lists of actions organized in tabs
with a quick search functionality.
-
class
orangecanvas.document.quickmenu.
QuickMenu
(parent=None, **kwargs)¶ Bases:
orangecanvas.gui.framelesswindow.FramelessWindow
A quick menu popup for the widgets.
The widgets are set using
QuickMenu.setModel()
which must be a model as returned byQtWidgetRegistry.model()
-
triggered
(QAction)¶ An action has been triggered in the menu.
-
hovered
(QAction)¶ An action has been hovered in the menu
-
setSizeGripEnabled
(enabled)¶ Enable the resizing of the menu with a size grip in a bottom right corner (enabled by default).
-
sizeGripEnabled
()¶ Is the size grip enabled.
-
addPage
(name, page)¶ Add the page (
MenuPage
) with name and return it’s index. The page.icon() will be used as the icon in the tab bar.
-
createPage
(index)¶ Create a new page based on the contents of an index (
QModeIndex
) item.
-
setModel
(model)¶ Set the model containing the actions.
-
setFilterFunc
(func)¶ Set a filter function.
-
popup
(pos=None, searchText='')¶ Popup the menu at pos (in screen coordinates). ‘Search’ text field is initialized with searchText if provided.
-
exec_
(pos=None, searchText='')¶ Execute the menu at position pos (in global screen coordinates). Return the triggered
QAction
or None if no action was triggered. ‘Search’ text field is initialized with searchText if provided.
-
hideEvent
(event)¶ Reimplemented from
QWidget
-
setCurrentPage
(page)¶ Set the current shown page to page.
-
setCurrentIndex
(index)¶ Set the current page index.
-
triggerSearch
()¶ Trigger action search. This changes to current page to the ‘Suggest’ page and sets the keyboard focus to the search line edit.
-
-
class
orangecanvas.document.quickmenu.
MenuPage
(parent=None, title=None, icon=None, **kwargs)¶ Bases:
orangecanvas.gui.tooltree.ToolTree
A menu page in a
QuickMenu
widget, showing a list of actions. Shown actions can be disabled by setting a filtering function using thesetFilterFunc()
.-
setTitle
(title)¶ Set the title of the page.
-
title
()¶ Return the title of this page.
-
setIcon
(icon)¶ Set icon for this menu page.
-
icon
()¶ Return the icon of this manu page.
-
setFilterFunc
(func)¶ Set the filtering function. func should a function taking a single
QModelIndex
argument and returning True if the item at index should be disabled and False otherwise. To disable filtering func can be set toNone
.
-
setModel
(model)¶ Reimplemented from
ToolTree.setModel()
.
-
setRootIndex
(index)¶ Reimplemented from
ToolTree.setRootIndex()
-
rootIndex
()¶ Reimplemented from
ToolTree.rootIndex()
-
sizeHint
()¶ Reimplemented from
QWidget.sizeHint()
.
-