Subgroup: Locator

Class: QgsLocatorModel

class qgis.core.QgsLocatorModel

Bases: PyQt5.QtCore.QAbstractTableModel

An abstract list model for displaying the results of locator searches.

Note that this class should generally be used with a QgsLocatorProxyModel in order to ensure correct sorting of results by priority and match level.

New in version 3.0: Methods

addResult Adds a new result to the model.
beginInsertColumns
beginInsertRows
beginMoveColumns
beginMoveRows
beginRemoveColumns
beginRemoveRows
beginResetModel
blockSignals
buddy
canDropMimeData
canFetchMore
changePersistentIndex
changePersistentIndexList
childEvent
children
clear Resets the model and clears all existing results.
columnCount
connectNotify
createIndex
customEvent
data
decodeData
deferredClear Resets the model and clears all existing results after a short delay, or whenever the next result is added to the model (whichever occurs first).
deleteLater
disconnect
disconnectNotify
dropMimeData
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
encodeData
endInsertColumns
endInsertRows
endMoveColumns
endMoveRows
endRemoveColumns
endRemoveRows
endResetModel
event
eventFilter
fetchMore
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]
flags
hasChildren
hasIndex
headerData
index
inherits
insertColumn
insertColumns
insertRow
insertRows
installEventFilter
isSignalConnected
isWidgetType
isWindowType
itemData
killTimer
match
metaObject
mimeData
mimeTypes
moveColumn
moveColumns
moveRow
moveRows
moveToThread
objectName
parent
persistentIndexList
property
pyqtConfigure Each keyword argument is either the name of a Qt property or a Qt signal.
receivers
removeColumn
removeColumns
removeEventFilter
removeRow
removeRows
resetInternalData
revert
roleNames
rowCount
sender
senderSignalIndex
setData
setHeaderData
setItemData
setObjectName
setParent
setProperty
sibling
signalsBlocked
sort
span
startTimer
submit
supportedDragActions
supportedDropActions
thread
timerEvent
tr

Attributes

HorizontalSortHint
NoLayoutChangeHint
ResultDataRole
ResultFilterNameRole
ResultFilterPriorityRole
ResultScoreRole
ResultTypeRole
VerticalSortHint
columnsAboutToBeInserted columnsAboutToBeInserted(self, QModelIndex, int, int) [signal]
columnsAboutToBeMoved columnsAboutToBeMoved(self, QModelIndex, int, int, QModelIndex, int) [signal]
columnsAboutToBeRemoved columnsAboutToBeRemoved(self, QModelIndex, int, int) [signal]
columnsInserted columnsInserted(self, QModelIndex, int, int) [signal]
columnsMoved columnsMoved(self, QModelIndex, int, int, QModelIndex, int) [signal]
columnsRemoved columnsRemoved(self, QModelIndex, int, int) [signal]
dataChanged dataChanged(self, QModelIndex, QModelIndex, Iterable[int] = []) [signal]
destroyed destroyed(self, QObject = None) [signal]
layoutAboutToBeChanged layoutAboutToBeChanged(self, object = QList<QPersistentModelIndex>(), QAbstractItemModel.LayoutChangeHint = QAbstractItemModel.NoLayoutChangeHint) [signal]
layoutChanged layoutChanged(self, Iterable[QPersistentModelIndex] = [], QAbstractItemModel.LayoutChangeHint = QAbstractItemModel.NoLayoutChangeHint) [signal]
modelAboutToBeReset modelAboutToBeReset(self) [signal]
modelReset modelReset(self) [signal]
objectNameChanged objectNameChanged(self, str) [signal]
rowsAboutToBeInserted rowsAboutToBeInserted(self, QModelIndex, int, int) [signal]
rowsAboutToBeMoved rowsAboutToBeMoved(self, QModelIndex, int, int, QModelIndex, int) [signal]
rowsAboutToBeRemoved rowsAboutToBeRemoved(self, QModelIndex, int, int) [signal]
rowsInserted rowsInserted(self, QModelIndex, int, int) [signal]
rowsMoved rowsMoved(self, QModelIndex, int, int, QModelIndex, int) [signal]
rowsRemoved rowsRemoved(self, QModelIndex, int, int) [signal]
staticMetaObject
ResultDataRole = 257
ResultFilterNameRole = 261
ResultFilterPriorityRole = 259
ResultScoreRole = 260
ResultTypeRole = 258
class Role

Bases: int

addResult(self, result: QgsLocatorResult)

Adds a new result to the model.

beginInsertColumns()
beginInsertRows()
beginMoveColumns()
beginMoveRows()
beginRemoveColumns()
beginRemoveRows()
beginResetModel()
changePersistentIndex()
changePersistentIndexList()
childEvent()
clear(self)

Resets the model and clears all existing results.

See also

deferredClear()

columnCount(self, parent: QModelIndex = QModelIndex()) → int
connectNotify()
createIndex()
customEvent()
data(self, index: QModelIndex, role: int = Qt.DisplayRole) → Any
decodeData()
deferredClear(self)

Resets the model and clears all existing results after a short delay, or whenever the next result is added to the model (whichever occurs first). Using deferredClear() instead of clear() can avoid the visually distracting frequent clears which may occur if the model is being updated quickly multiple times as a result of users typing in a search query.

See also

deferredClear()

disconnectNotify()
encodeData()
endInsertColumns()
endInsertRows()
endMoveColumns()
endMoveRows()
endRemoveColumns()
endRemoveRows()
endResetModel()
flags(self, index: QModelIndex) → Qt.ItemFlags
isSignalConnected()
persistentIndexList()
receivers()
resetInternalData()
rowCount(self, parent: QModelIndex = QModelIndex()) → int
sender()
senderSignalIndex()
timerEvent()