Class: QgsQueryResultModel¶
- class qgis.core.QgsQueryResultModel¶
Bases:
PyQt5.QtCore.QAbstractTableModel
The
QgsQueryResultModel
class is a model forQgsAbstractDatabaseProviderConnection
.QueryResultNew in version 3.18.
QgsQueryResultModel(queryResult: QgsAbstractDatabaseProviderConnection.QueryResult, parent: QObject = None) Constructs a
QgsQueryResultModel
from aqueryResult
with optionalparent
Methods
beginInsertColumns
beginInsertRows
beginMoveColumns
beginMoveRows
beginRemoveColumns
beginRemoveRows
- param parent
Cancels the row fetching.
changePersistentIndex
- param parent
Returns the column names
createIndex
- param index
decodeData
- param parent
- param section
Returns the query result
- param parent
Triggered when
newRows
have been fetched and can be added to the model.Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- QgsQueryResultModel.beginInsertColumns(self, QModelIndex, int, int)
- QgsQueryResultModel.beginInsertRows(self, QModelIndex, int, int)
- QgsQueryResultModel.beginMoveColumns(self, QModelIndex, int, int, QModelIndex, int) -> bool
- QgsQueryResultModel.beginMoveRows(self, QModelIndex, int, int, QModelIndex, int) -> bool
- QgsQueryResultModel.beginRemoveColumns(self, QModelIndex, int, int)
- QgsQueryResultModel.beginRemoveRows(self, QModelIndex, int, int)
- beginResetModel(self)¶
- canFetchMore(self, parent: QModelIndex) bool ¶
- Parameters
parent (QModelIndex) –
- Return type
bool
- cancel(self)¶
Cancels the row fetching.
- QgsQueryResultModel.changePersistentIndex(self, QModelIndex, QModelIndex)
- changePersistentIndexList(self, Iterable[QModelIndex], Iterable[QModelIndex])¶
- childEvent(self, QChildEvent)¶
- columnCount(self, parent: QModelIndex) int ¶
- Parameters
parent (QModelIndex) –
- Return type
int
- columns(self) List[str] ¶
Returns the column names
- Return type
List[str]
- connectNotify(self, QMetaMethod)¶
- QgsQueryResultModel.createIndex(self, int, int, object: object = 0) -> QModelIndex
- customEvent(self, QEvent)¶
- data(self, index: QModelIndex, role: int) Any ¶
- Parameters
index (QModelIndex) –
role (int) –
- Return type
Any
- QgsQueryResultModel.decodeData(self, int, int, QModelIndex, QDataStream) -> bool
- disconnectNotify(self, QMetaMethod)¶
- encodeData(self, Iterable[QModelIndex], QDataStream)¶
- endInsertColumns(self)¶
- endInsertRows(self)¶
- endMoveColumns(self)¶
- endMoveRows(self)¶
- endRemoveColumns(self)¶
- endRemoveRows(self)¶
- endResetModel(self)¶
- fetchMore(self, parent: QModelIndex)¶
- Parameters
parent (QModelIndex) –
- fetchMoreRows¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type
PYQT_SIGNAL
- fetchingComplete¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type
PYQT_SIGNAL
- fetchingStarted¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type
PYQT_SIGNAL
- headerData(self, section: int, orientation: Qt.Orientation, role: int) Any ¶
- Parameters
section (int) –
orientation (Qt.Orientation) –
role (int) –
- Return type
Any
- isSignalConnected(self, QMetaMethod) bool ¶
- persistentIndexList(self) List[QModelIndex] ¶
- queryResult(self) QgsAbstractDatabaseProviderConnection.QueryResult ¶
Returns the query result
New in version 3.22.
- receivers(self, PYQT_SIGNAL) int ¶
- resetInternalData(self)¶
- rowCount(self, parent: QModelIndex) int ¶
- Parameters
parent (QModelIndex) –
- Return type
int
- rowsReady(self, rows: object)¶
Triggered when
newRows
have been fetched and can be added to the model.- Parameters
rows (object) –
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- timerEvent(self, QTimerEvent)¶