Subgroup: other
Class: QgsFilterLineEdit¶
-
class
qgis.gui.
QgsFilterLineEdit
¶ Bases:
PyQt5.QtWidgets.QLineEdit
QLineEdit subclass with built in support for clearing the widget’s value and handling custom null value representations.
When using QgsFilterLineEdit the value(), setValue() and clearValue() methods should be used instead of QLineEdit’s text(), setText() and clear() methods, and the valueChanged() signal should be used instead of textChanged(). *
Methods
acceptDrops
accessibleDescription
accessibleName
actionEvent
actions
activateWindow
addAction
addAction(self, QAction, QLineEdit.ActionPosition) addActions
adjustSize
alignment
autoFillBackground
backgroundRole
backspace
baseSize
blockSignals
changeEvent
childAt
childAt(self, int, int) -> QWidget childEvent
children
childrenRect
childrenRegion
clear
clearFocus
clearMask
clearMode
Returns the clear mode for the widget. clearValue
Clears the widget and resets it to the null value. close
closeEvent
colorCount
completer
connectNotify
contentsMargins
contentsRect
contextMenuEvent
contextMenuPolicy
copy
create
createStandardContextMenu
createWindowContainer
cursor
cursorBackward
cursorForward
cursorMoveStyle
cursorPosition
cursorPositionAt
cursorRect
cursorWordBackward
cursorWordForward
customEvent
cut
defaultValue
Returns the default value for the widget. del_
deleteLater
depth
deselect
destroy
devType
devicePixelRatio
devicePixelRatioF
devicePixelRatioFScale
disconnect
disconnectNotify
displayText
dragEnabled
dragEnterEvent
dragLeaveEvent
dragMoveEvent
dropEvent
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
echoMode
effectiveWinId
end
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
frameGeometry
frameSize
geometry
getContentsMargins
getTextMargins
grab
grabGesture
grabKeyboard
grabMouse
grabMouse(self, Union[QCursor, Qt.CursorShape]) grabShortcut
graphicsEffect
graphicsProxyWidget
hasAcceptableInput
hasFocus
hasFrame
hasHeightForWidth
hasMouseTracking
hasSelectedText
hasTabletTracking
height
heightForWidth
heightMM
hide
hideEvent
home
inherits
initPainter
initStyleOption
inputMask
inputMethodEvent
inputMethodHints
inputMethodQuery
inputMethodQuery(self, Qt.InputMethodQuery, Any) -> Any insert
insertAction
insertActions
installEventFilter
isActiveWindow
isAncestorOf
isClearButtonEnabled
isEnabled
isEnabledTo
isFullScreen
isHidden
isLeftToRight
isMaximized
isMinimized
isModal
isModified
isNull
Determine if the current text represents null. isReadOnly
isRedoAvailable
isRightToLeft
isSignalConnected
isUndoAvailable
isVisible
isVisibleTo
isWidgetType
isWindow
isWindowModified
isWindowType
keyPressEvent
keyReleaseEvent
keyboardGrabber
killTimer
layout
layoutDirection
leaveEvent
locale
logicalDpiX
logicalDpiY
lower
mapFrom
mapFromGlobal
mapFromParent
mapTo
mapToGlobal
mapToParent
mask
maxLength
maximumHeight
maximumSize
maximumWidth
metaObject
metric
minimumHeight
minimumSize
minimumSizeHint
minimumWidth
mouseDoubleClickEvent
mouseGrabber
mouseMoveEvent
mousePressEvent
mouseReleaseEvent
move
move(self, int, int) moveEvent
moveToThread
nativeEvent
nativeParentWidget
nextInFocusChain
normalGeometry
nullValue
Returns the string used for representating null values in the widget. objectName
overrideWindowFlags
overrideWindowState
paintEngine
paintEvent
paintingActive
palette
parent
parentWidget
paste
physicalDpiX
physicalDpiY
placeholderText
pos
previousInFocusChain
property
pyqtConfigure
Each keyword argument is either the name of a Qt property or a Qt signal. raise_
receivers
rect
redo
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) resize
resize(self, int, int) resizeEvent
restoreGeometry
saveGeometry
scroll
scroll(self, int, int, QRect) selectAll
selectOnFocus
Will select all text when this widget receives the focus. selectedText
selectionStart
sender
senderSignalIndex
setAcceptDrops
setAccessibleDescription
setAccessibleName
setAlignment
setAttribute
setAutoFillBackground
setBackgroundRole
setBaseSize
setBaseSize(self, QSize) setClearButtonEnabled
setClearMode
Sets the clear mode for the widget. setCompleter
setContentsMargins
setContentsMargins(self, QMargins) setContextMenuPolicy
setCursor
setCursorMoveStyle
setCursorPosition
setDefaultValue
Sets the default value for the widget. setDisabled
setDragEnabled
setEchoMode
setEnabled
setFixedHeight
setFixedSize
setFixedSize(self, int, int) setFixedWidth
setFocus
setFocus(self, Qt.FocusReason) setFocusPolicy
setFocusProxy
setFont
setForegroundRole
setFrame
setGeometry
setGeometry(self, int, int, int, int) setGraphicsEffect
setHidden
setInputMask
setInputMethodHints
setLayout
setLayoutDirection
setLocale
setMask
setMask(self, QRegion) setMaxLength
setMaximumHeight
setMaximumSize
setMaximumSize(self, QSize) setMaximumWidth
setMinimumHeight
setMinimumSize
setMinimumSize(self, QSize) setMinimumWidth
setModified
setMouseTracking
setNullValue
Sets the string representation for null values in the widget. setObjectName
setPalette
setParent
setParent(self, QWidget, Union[Qt.WindowFlags, Qt.WindowType]) setPlaceholderText
setProperty
setReadOnly
setSelectOnFocus
Will select all text when this widget receives the focus. setSelection
setShortcutAutoRepeat
setShortcutEnabled
setShowClearButton
Sets whether the widget’s clear button is visible. setShowSearchIcon
Define if a search icon shall be shown on the left of the image setShowSpinner
Show a spinner icon. setSizeIncrement
setSizeIncrement(self, QSize) setSizePolicy
setSizePolicy(self, QSizePolicy.Policy, QSizePolicy.Policy) setStatusTip
setStyle
setStyleSheet
setTabOrder
setTabletTracking
setText
setTextMargins
setTextMargins(self, QMargins) setToolTip
setToolTipDuration
setUpdatesEnabled
setValidator
setValue
Sets the current text for the widget with support for handling null values. setVisible
setWhatsThis
setWindowFilePath
setWindowFlag
setWindowFlags
setWindowIcon
setWindowIconText
setWindowModality
setWindowModified
setWindowOpacity
setWindowRole
setWindowState
setWindowTitle
sharedPainter
show
showClearButton
Returns true if the widget’s clear button is visible. showEvent
showFullScreen
showMaximized
showMinimized
showNormal
showSearchIcon
Returns if a search icon shall be shown on the left of the image showSpinner
Show a spinner icon. signalsBlocked
size
sizeHint
sizeIncrement
sizePolicy
stackUnder
startTimer
statusTip
style
styleSheet
tabletEvent
testAttribute
text
textMargins
thread
timerEvent
toolTip
toolTipDuration
tr
underMouse
undo
ungrabGesture
unsetCursor
unsetLayoutDirection
unsetLocale
update
update(self, QRect) updateGeometry
updateMicroFocus
updatesEnabled
validator
value
Returns the text of this edit with support for handling null values. visibleRegion
whatsThis
wheelEvent
width
widthMM
winId
window
windowFilePath
windowFlags
windowHandle
windowIcon
windowIconText
windowModality
windowOpacity
windowRole
windowState
windowTitle
windowType
x
y
Attributes
ClearToDefault
ClearToNull
DrawChildren
DrawWindowBackground
IgnoreMask
LeadingPosition
NoEcho
Normal
Password
PasswordEchoOnEdit
PdmDepth
PdmDevicePixelRatio
PdmDevicePixelRatioScaled
PdmDpiX
PdmDpiY
PdmHeight
PdmHeightMM
PdmNumColors
PdmPhysicalDpiX
PdmPhysicalDpiY
PdmWidth
PdmWidthMM
TrailingPosition
cleared
Emitted when the widget is cleared cursorPositionChanged
cursorPositionChanged(self, int, int) [signal] customContextMenuRequested
customContextMenuRequested(self, QPoint) [signal] destroyed
destroyed(self, QObject = None) [signal] editingFinished
editingFinished(self) [signal] objectNameChanged
objectNameChanged(self, str) [signal] returnPressed
returnPressed(self) [signal] selectOnFocusChanged
Will select all text when this widget receives the focus. selectionChanged
selectionChanged(self) [signal] showSpinnerChanged
Show a spinner icon. staticMetaObject
textChanged
textChanged(self, str) [signal] textEdited
textEdited(self, str) [signal] valueChanged
Same as textChanged() but with support for null values. windowIconChanged
windowIconChanged(self, QIcon) [signal] windowIconTextChanged
windowIconTextChanged(self, str) [signal] windowTitleChanged
windowTitleChanged(self, str) [signal] -
class
ClearMode
¶ Bases:
int
-
ClearToDefault
= 1¶
-
ClearToNull
= 0¶
-
actionEvent
()¶
-
changeEvent
()¶
-
childEvent
()¶
-
clearMode
(self) → QgsFilterLineEdit.ClearMode¶ Returns the clear mode for the widget. The clear mode defines the behavior of the widget when its value is cleared. This defaults to ClearToNull.
See also
New in version 3.0.
-
clearValue
(self)¶ Clears the widget and resets it to the null value.
See also
New in version 3.0.
-
cleared
¶ Emitted when the widget is cleared
See also
clearValue()
[signal]
-
closeEvent
()¶
-
connectNotify
()¶
-
contextMenuEvent
()¶
-
create
()¶
-
cursorRect
()¶
-
customEvent
()¶
-
defaultValue
(self) → str¶ Returns the default value for the widget. The default value is a value which the widget will be reset to if it is cleared and the clearMode() is equal to ClearToDefault.
See also
See also
New in version 3.0.
-
destroy
()¶
-
disconnectNotify
()¶
-
dragEnterEvent
()¶
-
dragLeaveEvent
()¶
-
dragMoveEvent
()¶
-
dropEvent
()¶
-
enterEvent
()¶
-
focusInEvent
(self, e: QFocusEvent)¶
-
focusNextChild
()¶
-
focusNextPrevChild
()¶
-
focusOutEvent
()¶
-
focusPreviousChild
()¶
-
hideEvent
()¶
-
initPainter
()¶
-
initStyleOption
()¶
-
inputMethodEvent
()¶
-
isNull
(self) → bool¶ Determine if the current text represents null.
Returns: True if the widget’s value is null. See also
-
isSignalConnected
()¶
-
keyPressEvent
()¶
-
keyReleaseEvent
()¶
-
leaveEvent
(self, e: QEvent)¶
-
metric
()¶
-
mouseDoubleClickEvent
()¶
-
mouseMoveEvent
(self, e: QMouseEvent)¶
-
mousePressEvent
(self, e: QMouseEvent)¶
-
mouseReleaseEvent
()¶
-
moveEvent
()¶
-
nativeEvent
()¶
-
nullValue
(self) → str¶ Returns the string used for representating null values in the widget.
See also
See also
-
paintEvent
(self, e: QPaintEvent)¶
-
receivers
()¶
-
resizeEvent
()¶
-
selectOnFocus
(self) → bool¶ Will select all text when this widget receives the focus.
New in version 3.0.
-
selectOnFocusChanged
¶ Will select all text when this widget receives the focus.
New in version 3.0: [signal]
-
sender
()¶
-
senderSignalIndex
()¶
-
setClearMode
(self, mode: QgsFilterLineEdit.ClearMode)¶ Sets the clear mode for the widget. The clear mode defines the behavior of the widget when its value is cleared. This defaults to ClearToNull.
See also
New in version 3.0.
-
setDefaultValue
(self, defaultValue: str)¶ Sets the default value for the widget. The default value is a value which the widget will be reset to if it is cleared and the clearMode() is equal to ClearToDefault.
Parameters: defaultValue – default value See also
See also
New in version 3.0.
-
setNullValue
(self, nullValue: str)¶ Sets the string representation for null values in the widget. This does not affect the values returned for null values by value(), rather it only affects the text that is shown to users when the widget’s value is null.
Parameters: nullValue – string to show when widget’s value is null See also
-
setSelectOnFocus
(self, selectOnFocus: bool)¶ Will select all text when this widget receives the focus.
New in version 3.0.
-
setShowClearButton
(self, visible: bool)¶ Sets whether the widget’s clear button is visible.
Parameters: visible – set to false to hide the clear button See also
New in version 3.0.
-
setShowSearchIcon
(self, visible: bool)¶ Define if a search icon shall be shown on the left of the image when no text is entered
Parameters: visible – set to false to hide the search icon New in version 3.0.
-
setShowSpinner
(self, showSpinner: bool)¶ Show a spinner icon. This can be used for search boxes to indicate that something is going on in the background.
New in version 3.0.
-
setValue
(self, value: str)¶ Sets the current text for the widget with support for handling null values.
Parameters: value – The text to set. If a null string is provided, the text shown in the widget will be set to the current nullValue().
See also
-
showClearButton
(self) → bool¶ Returns true if the widget’s clear button is visible.
See also
New in version 3.0.
-
showEvent
()¶
-
showSearchIcon
(self) → bool¶ Returns if a search icon shall be shown on the left of the image when no text is entered
New in version 3.0.
-
showSpinner
(self) → bool¶ Show a spinner icon. This can be used for search boxes to indicate that something is going on in the background.
New in version 3.0.
-
showSpinnerChanged
¶ Show a spinner icon. This can be used for search boxes to indicate that something is going on in the background.
New in version 3.0: [signal]
-
tabletEvent
()¶
-
timerEvent
()¶
-
updateMicroFocus
()¶
-
value
(self) → str¶ Returns the text of this edit with support for handling null values. If the text in the widget matches the current nullValue() then the returned value will be a null string.
Returns: Current text (or null string if it matches the nullValue() property ) See also
-
valueChanged
¶ Same as textChanged() but with support for null values.
Parameters: value – The current text or null string if it matches the nullValue() property. [signal]
-
wheelEvent
()¶
-
class