Subgroup: Attribute
Class: QgsAttributeFormWidget¶
-
class
qgis.gui.
QgsAttributeFormWidget
¶ Bases:
PyQt5.QtWidgets.QWidget
Base class for all widgets shown on a QgsAttributeForm. Consists of the widget which is visible in edit mode as well as the widget visible in search mode.
New in version 3.0: Methods
acceptDrops
accessibleDescription
accessibleName
actionEvent
actions
activateWindow
addAction
addActions
addAdditionalSearchWidgetWrapper
Adds an additional search widget wrapper. adjustSize
autoFillBackground
backgroundRole
baseSize
blockSignals
changeEvent
childAt
childAt(self, int, int) -> QWidget childEvent
children
childrenRect
childrenRegion
clearFocus
clearMask
close
closeEvent
colorCount
connectNotify
contentsMargins
contentsRect
contextMenuEvent
contextMenuPolicy
create
createSearchWidgetWrappers
Creates the search widget wrappers for the widget used when the form is in search mode. createWindowContainer
currentFilterExpression
Creates an expression matching the current search filter value and search properties represented in the widget. cursor
customEvent
deleteLater
depth
destroy
devType
devicePixelRatio
devicePixelRatioF
devicePixelRatioFScale
disconnect
disconnectNotify
dragEnterEvent
dragLeaveEvent
dragMoveEvent
dropEvent
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
effectiveWinId
ensurePolished
enterEvent
event
eventFilter
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
form
The form on which this widget is shown. 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
inherits
initPainter
inputMethodEvent
inputMethodHints
inputMethodQuery
insertAction
insertActions
installEventFilter
isActiveWindow
isAncestorOf
isEnabled
isEnabledTo
isFullScreen
isHidden
isLeftToRight
isMaximized
isMinimized
isModal
isRightToLeft
isSignalConnected
isVisible
isVisibleTo
isWidgetType
isWindow
isWindowModified
isWindowType
keyPressEvent
keyReleaseEvent
keyboardGrabber
killTimer
layer
The layer for which this widget and its form is shown. layout
layoutDirection
leaveEvent
locale
logicalDpiX
logicalDpiY
lower
mapFrom
mapFromGlobal
mapFromParent
mapTo
mapToGlobal
mapToParent
mask
maximumHeight
maximumSize
maximumWidth
metaObject
metric
minimumHeight
minimumSize
minimumSizeHint
minimumWidth
mode
Returns the current mode for the widget. 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
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
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) resetSearch
Resets the search/filter value of the widget. resize
resize(self, int, int) resizeEvent
restoreGeometry
saveGeometry
scroll
scroll(self, int, int, QRect) searchWidgetToolButtonVisible
The visibility of the search widget tool button, that allows (de)activating this search widgte or defines the comparison operator to use. searchWidgetWrappers
Returns the search widget wrapper used in this widget. sender
senderSignalIndex
setAcceptDrops
setAccessibleDescription
setAccessibleName
setAttribute
setAutoFillBackground
setBackgroundRole
setBaseSize
setBaseSize(self, QSize) setContentsMargins
setContentsMargins(self, QMargins) setContextMenuPolicy
setCursor
setDisabled
setEnabled
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
setInputMethodHints
setLayout
setLayoutDirection
setLocale
setMask
setMask(self, QRegion) setMaximumHeight
setMaximumSize
setMaximumSize(self, QSize) setMaximumWidth
setMinimumHeight
setMinimumSize
setMinimumSize(self, QSize) setMinimumWidth
setMode
Sets the current mode for the widget. setMouseTracking
setObjectName
setPalette
setParent
setParent(self, QWidget, Union[Qt.WindowFlags, Qt.WindowType]) setProperty
setSearchWidgetToolButtonVisible
The visibility of the search widget tool button, that allows (de)activating this search widgte or defines the comparison operator to use. setSearchWidgetWrapper
Sets the search widget wrapper for the widget used when the form is in search mode. setShortcutAutoRepeat
setShortcutEnabled
setSizeIncrement
setSizeIncrement(self, QSize) setSizePolicy
setSizePolicy(self, QSizePolicy.Policy, QSizePolicy.Policy) setStatusTip
setStyle
setStyleSheet
setTabOrder
setTabletTracking
setToolTip
setToolTipDuration
setUpdatesEnabled
setVisible
setWhatsThis
setWindowFilePath
setWindowFlag
setWindowFlags
setWindowIcon
setWindowIconText
setWindowModality
setWindowModified
setWindowOpacity
setWindowRole
setWindowState
setWindowTitle
sharedPainter
show
showEvent
showFullScreen
showMaximized
showMinimized
showNormal
signalsBlocked
size
sizeHint
sizeIncrement
sizePolicy
stackUnder
startTimer
statusTip
style
styleSheet
tabletEvent
testAttribute
thread
timerEvent
toolTip
toolTipDuration
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
AggregateSearchMode
DefaultMode
DrawChildren
DrawWindowBackground
IgnoreMask
MultiEditMode
PdmDepth
PdmDevicePixelRatio
PdmDevicePixelRatioScaled
PdmDpiX
PdmDpiY
PdmHeight
PdmHeightMM
PdmNumColors
PdmPhysicalDpiX
PdmPhysicalDpiY
PdmWidth
PdmWidthMM
SearchMode
customContextMenuRequested
customContextMenuRequested(self, QPoint) [signal] destroyed
destroyed(self, QObject = None) [signal] objectNameChanged
objectNameChanged(self, str) [signal] staticMetaObject
windowIconChanged
windowIconChanged(self, QIcon) [signal] windowIconTextChanged
windowIconTextChanged(self, str) [signal] windowTitleChanged
windowTitleChanged(self, str) [signal] -
AggregateSearchMode
= 3¶
-
DefaultMode
= 0¶
-
class
Mode
¶ Bases:
int
-
MultiEditMode
= 1¶
-
SearchMode
= 2¶
-
addAdditionalSearchWidgetWrapper
(self, wrapper: QgsSearchWidgetWrapper)¶ Adds an additional search widget wrapper. Used to register a secondary search widget as used for “between” searches.
-
createSearchWidgetWrappers
(self)¶ Creates the search widget wrappers for the widget used when the form is in search mode.
Parameters: context – editor context (not available in Python bindings)
-
currentFilterExpression
(self) → str¶ Creates an expression matching the current search filter value and search properties represented in the widget.
New in version 2.16.
-
form
(self) → QgsAttributeForm¶ The form on which this widget is shown.
-
layer
(self) → QgsVectorLayer¶ The layer for which this widget and its form is shown.
-
mode
(self) → QgsAttributeFormWidget.Mode¶ Returns the current mode for the widget.
See also
-
resetSearch
(self)¶ Resets the search/filter value of the widget.
-
searchWidgetToolButtonVisible
(self) → bool¶ The visibility of the search widget tool button, that allows (de)activating this search widgte or defines the comparison operator to use.
-
searchWidgetWrappers
(self) → object¶ Returns the search widget wrapper used in this widget. The wrapper must first be created using createSearchWidgetWrapper()
Note
this method is in place for unit testing only, and is not considered stable API
-
setMode
(self, mode: QgsAttributeFormWidget.Mode)¶ Sets the current mode for the widget. The widget will adapt its state and visible widgets to reflect the updated mode. For example, showing multi edit tool buttons if the mode is set to MultiEditMode.
Parameters: mode – widget mode See also
-
setSearchWidgetToolButtonVisible
(self, searchWidgetToolButtonVisible: bool)¶ The visibility of the search widget tool button, that allows (de)activating this search widgte or defines the comparison operator to use.
-
setSearchWidgetWrapper
(self, wrapper: QgsSearchWidgetWrapper)¶ Sets the search widget wrapper for the widget used when the form is in search mode.
Parameters: wrapper – search widget wrapper. Note
the search widget wrapper should be created using searchWidgetFrame() as its parent
Note
this method is in place for unit testing only, and is not considered stable API
-