Subgroup: other
Class: QgsIdentifyMenu¶
-
class
qgis.gui.
QgsIdentifyMenu
¶ Bases:
PyQt5.QtWidgets.QMenu
The QgsIdentifyMenu class builds a menu to be used with identify results (
QgsMapToolIdentify
). It is customizable and can display attribute actions (QgsAction
) as well as map layer actions (see QgsMapLayerAction). It can also embed custom map layer actions, defined for this menu exclusively. If used in a QgsMapToolIdentify, it is accessible via QgsMapToolIdentify.identifyMenu() and can be customized in the map tool sub-class.Methods
acceptDrops
accessibleDescription
accessibleName
actionAt
actionEvent
actionGeometry
actions
activateWindow
activeAction
addAction
addAction(self, str) -> QAction addActions
addCustomAction
adds a new custom action to the menu addMenu
addMenu(self, str) -> QMenu addSection
addSection(self, QIcon, str) -> QAction addSeparator
adjustSize
allowMultipleReturn
autoFillBackground
backgroundRole
baseSize
blockSignals
changeEvent
childAt
childAt(self, int, int) -> QWidget childEvent
children
childrenRect
childrenRegion
clear
clearFocus
clearMask
close
closeEvent
colorCount
columnCount
connectNotify
contentsMargins
contentsRect
contextMenuEvent
contextMenuPolicy
create
createWindowContainer
cursor
customEvent
defaultAction
deleteLater
depth
destroy
devType
devicePixelRatio
devicePixelRatioF
devicePixelRatioFScale
disconnect
disconnectNotify
dragEnterEvent
dragLeaveEvent
dragMoveEvent
dropEvent
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
effectiveWinId
ensurePolished
enterEvent
event
eventFilter
exec
exec execWithSingleResult
exec_
exec_(self, QPoint, action: QAction = None) -> QAction expressionContextScope
Returns an expression context scope used to resolve underlying actions. find
findChild
findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject findChildren
findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] focusInEvent
focusNextChild
focusNextPrevChild
focusOutEvent
focusPolicy
focusPreviousChild
focusProxy
focusWidget
font
fontInfo
fontMetrics
foregroundRole
frameGeometry
frameSize
geometry
getContentsMargins
grab
grabGesture
grabKeyboard
grabMouse
grabMouse(self, Union[QCursor, Qt.CursorShape]) grabShortcut
graphicsEffect
graphicsProxyWidget
hasFocus
hasHeightForWidth
hasMouseTracking
hasTabletTracking
height
heightForWidth
heightMM
hide
hideEvent
hideTearOffMenu
icon
inherits
initPainter
initStyleOption
inputMethodEvent
inputMethodHints
inputMethodQuery
insertAction
insertActions
insertMenu
insertSection
insertSection(self, QAction, QIcon, str) -> QAction insertSeparator
installEventFilter
isActiveWindow
isAncestorOf
isEmpty
isEnabled
isEnabledTo
isFullScreen
isHidden
isLeftToRight
isMaximized
isMinimized
isModal
isRightToLeft
isSignalConnected
isTearOffEnabled
isTearOffMenuVisible
isVisible
isVisibleTo
isWidgetType
isWindow
isWindowModified
isWindowType
keyPressEvent
keyReleaseEvent
keyboardGrabber
killTimer
layout
layoutDirection
leaveEvent
locale
logicalDpiX
logicalDpiY
lower
mapFrom
mapFromGlobal
mapFromParent
mapTo
mapToGlobal
mapToParent
mask
maxFeatureDisplay
maxLayerDisplay
maximumHeight
maximumSize
maximumWidth
menuAction
metaObject
metric
minimumHeight
minimumSize
minimumSizeHint
minimumWidth
mouseDoubleClickEvent
mouseGrabber
mouseMoveEvent
mousePressEvent
mouseReleaseEvent
move
move(self, int, int) moveEvent
moveToThread
nativeEvent
nativeParentWidget
nextInFocusChain
normalGeometry
objectName
overrideWindowFlags
overrideWindowState
paintEngine
paintEvent
paintingActive
palette
parent
parentWidget
physicalDpiX
physicalDpiY
popup
pos
previousInFocusChain
property
pyqtConfigure
Each keyword argument is either the name of a Qt property or a Qt signal. raise_
receivers
rect
releaseKeyboard
releaseMouse
releaseShortcut
removeAction
removeCustomActions
remove all custom actions from the menu to be built removeEventFilter
render
render(self, QPainter, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: Union[QWidget.RenderFlags, QWidget.RenderFlag] = QWidget.RenderFlags(QWidget.DrawWindowBackground|QWidget.DrawChildren)) repaint
repaint(self, int, int, int, int) resize
resize(self, int, int) resizeEvent
restoreGeometry
resultsIfExternalAction
saveGeometry
scroll
scroll(self, int, int, QRect) sender
senderSignalIndex
separatorsCollapsible
setAcceptDrops
setAccessibleDescription
setAccessibleName
setActiveAction
setAllowMultipleReturn
define if the menu executed can return multiple results (e.g. all results or all identified features of a vector layer) setAsDockMenu
setAttribute
setAutoFillBackground
setBackgroundRole
setBaseSize
setBaseSize(self, QSize) setContentsMargins
setContentsMargins(self, QMargins) setContextMenuPolicy
setCursor
setDefaultAction
setDisabled
setEnabled
setExecWithSingleResult
define if the menu will be shown with a single idetify result setExpressionContextScope
Sets an expression context scope used to resolve underlying actions. setFixedHeight
setFixedSize
setFixedSize(self, int, int) setFixedWidth
setFocus
setFocus(self, Qt.FocusReason) setFocusPolicy
setFocusProxy
setFont
setForegroundRole
setGeometry
setGeometry(self, int, int, int, int) setGraphicsEffect
setHidden
setIcon
setInputMethodHints
setLayout
setLayoutDirection
setLocale
setMask
setMask(self, QRegion) setMaxFeatureDisplay
Defines the maximum number of features displayed in the menu for vector layers (default is 10). setMaxLayerDisplay
Defines the maximum number of layers displayed in the menu (default is 10). setMaximumHeight
setMaximumSize
setMaximumSize(self, QSize) setMaximumWidth
setMinimumHeight
setMinimumSize
setMinimumSize(self, QSize) setMinimumWidth
setMouseTracking
setNoReplayFor
setObjectName
setPalette
setParent
setParent(self, QWidget, Union[Qt.WindowFlags, Qt.WindowType]) setProperty
setResultsIfExternalAction
setResultsIfExternalAction if set to false (default) the menu will not return any results if an external action has been triggered setSeparatorsCollapsible
setShortcutAutoRepeat
setShortcutEnabled
setShowFeatureActions
define if attribute actions(1) and map layer actions(2) can be listed and run from the menu setSizeIncrement
setSizeIncrement(self, QSize) setSizePolicy
setSizePolicy(self, QSizePolicy.Policy, QSizePolicy.Policy) setStatusTip
setStyle
setStyleSheet
setTabOrder
setTabletTracking
setTearOffEnabled
setTitle
setToolTip
setToolTipDuration
setToolTipsVisible
setUpdatesEnabled
setVisible
setWhatsThis
setWindowFilePath
setWindowFlag
setWindowFlags
setWindowIcon
setWindowIconText
setWindowModality
setWindowModified
setWindowOpacity
setWindowRole
setWindowState
setWindowTitle
sharedPainter
show
showEvent
showFeatureActions
showFullScreen
showMaximized
showMinimized
showNormal
showTearOffMenu
showTearOffMenu(self, QPoint) signalsBlocked
size
sizeHint
sizeIncrement
sizePolicy
stackUnder
startTimer
statusTip
style
styleSheet
tabletEvent
testAttribute
thread
timerEvent
title
toolTip
toolTipDuration
toolTipsVisible
tr
underMouse
ungrabGesture
unsetCursor
unsetLayoutDirection
unsetLocale
update
update(self, QRect) updateGeometry
updateMicroFocus
updatesEnabled
visibleRegion
whatsThis
wheelEvent
width
widthMM
winId
window
windowFilePath
windowFlags
windowHandle
windowIcon
windowIconText
windowModality
windowOpacity
windowRole
windowState
windowTitle
windowType
x
y
Attributes
DrawChildren
DrawWindowBackground
FeatureLevel
IgnoreMask
LayerLevel
PdmDepth
PdmDevicePixelRatio
PdmDevicePixelRatioScaled
PdmDpiX
PdmDpiY
PdmHeight
PdmHeightMM
PdmNumColors
PdmPhysicalDpiX
PdmPhysicalDpiY
PdmWidth
PdmWidthMM
aboutToHide
aboutToHide(self) [signal] aboutToShow
aboutToShow(self) [signal] customContextMenuRequested
customContextMenuRequested(self, QPoint) [signal] destroyed
destroyed(self, QObject = None) [signal] hovered
hovered(self, QAction) [signal] objectNameChanged
objectNameChanged(self, str) [signal] staticMetaObject
triggered
triggered(self, QAction) [signal] windowIconChanged
windowIconChanged(self, QIcon) [signal] windowIconTextChanged
windowIconTextChanged(self, str) [signal] windowTitleChanged
windowTitleChanged(self, str) [signal] -
class
ActionData
¶ Bases:
sip.wrapper
Constructor for ActionData
QgsIdentifyMenu.ActionData(layer: QgsMapLayer, mapLayerAction: QgsMapLayerAction = None)
QgsIdentifyMenu.ActionData(layer: QgsMapLayer, fid: int, mapLayerAction: QgsMapLayerAction = None)
QgsIdentifyMenu.ActionData(QgsIdentifyMenu.ActionData)
-
mAllResults
¶
-
mFeatureId
¶
-
mIsExternalAction
¶
-
mIsValid
¶
-
mLayer
¶
-
mLevel
¶
-
mMapLayerAction
¶
-
-
FeatureLevel
= 1¶
-
LayerLevel
= 0¶
-
class
MenuLevel
¶ Bases:
int
-
actionEvent
()¶
-
addCustomAction
(self, action: QgsMapLayerAction)¶ adds a new custom action to the menu
-
allowMultipleReturn
(self) → bool¶
-
changeEvent
()¶
-
childEvent
()¶
-
closeEvent
(self, e: QCloseEvent)¶
-
columnCount
()¶
-
connectNotify
()¶
-
contextMenuEvent
()¶
-
create
()¶
-
customEvent
()¶
-
destroy
()¶
-
disconnectNotify
()¶
-
dragEnterEvent
()¶
-
dragLeaveEvent
()¶
-
dragMoveEvent
()¶
-
dropEvent
()¶
-
enterEvent
()¶
-
event
()¶
-
exec
(self, idResults: Iterable[QgsMapToolIdentify.IdentifyResult], pos: QPoint) → object¶ exec
Parameters: - idResults – the list of identify results to choose within
- pos – the position where the menu will be executed
-
execWithSingleResult
(self) → bool¶
-
expressionContextScope
(self) → QgsExpressionContextScope¶ Returns an expression context scope used to resolve underlying actions.
New in version 3.0.
-
focusInEvent
()¶
-
focusNextChild
()¶
-
focusNextPrevChild
()¶
-
focusOutEvent
()¶
-
focusPreviousChild
()¶
-
hideEvent
()¶
-
initPainter
()¶
-
initStyleOption
()¶
-
inputMethodEvent
()¶
-
isSignalConnected
()¶
-
keyPressEvent
()¶
-
keyReleaseEvent
()¶
-
leaveEvent
()¶
-
maxFeatureDisplay
(self) → int¶
-
maxLayerDisplay
(self) → int¶
-
metric
()¶
-
mouseDoubleClickEvent
()¶
-
mouseMoveEvent
()¶
-
mousePressEvent
()¶
-
mouseReleaseEvent
()¶
-
moveEvent
()¶
-
nativeEvent
()¶
-
paintEvent
()¶
-
receivers
()¶
-
removeCustomActions
(self)¶ remove all custom actions from the menu to be built
-
resizeEvent
()¶
-
resultsIfExternalAction
(self) → bool¶
-
sender
()¶
-
senderSignalIndex
()¶
-
setAllowMultipleReturn
(self, multipleReturn: bool)¶ define if the menu executed can return multiple results (e.g. all results or all identified features of a vector layer)
-
setExecWithSingleResult
(self, execWithSingleResult: bool)¶ define if the menu will be shown with a single idetify result
-
setExpressionContextScope
(self, scope: QgsExpressionContextScope)¶ Sets an expression context scope used to resolve underlying actions.
New in version 3.0.
-
setMaxFeatureDisplay
(self, maxFeatureDisplay: int)¶ Defines the maximum number of features displayed in the menu for vector layers (default is 10).
Note
0 is unlimited.
-
setMaxLayerDisplay
(self, maxLayerDisplay: int)¶ Defines the maximum number of layers displayed in the menu (default is 10).
Note
0 is unlimited.
-
setResultsIfExternalAction
(self, resultsIfExternalAction: bool)¶ setResultsIfExternalAction if set to false (default) the menu will not return any results if an external action has been triggered
Note
external action can be either custom actions or feature / map layer actions (
setShowFeatureActions()
)
-
setShowFeatureActions
(self, showFeatureActions: bool)¶ define if attribute actions(1) and map layer actions(2) can be listed and run from the menu
Note
custom actions will be shown in any case if they exist.
Note
- attribute actions are defined by the user in the layer properties
QgsAction
Note
- map layer actions are built-in c++ actions or actions which are defined by a Python plugin
QgsMapLayerActionRegistry
- attribute actions are defined by the user in the layer properties
-
showEvent
()¶
-
showFeatureActions
(self) → bool¶
-
tabletEvent
()¶
-
timerEvent
()¶
-
updateMicroFocus
()¶
-
wheelEvent
()¶
-
class