Subgroup: Layout

Class: QgsLayoutGuideCollection

class qgis.core.QgsLayoutGuideCollection

Bases: PyQt5.QtCore.QAbstractTableModel, qgis._core.QgsLayoutSerializableObject

Stores and manages the snap guides used by a layout.

New in version 3.0: Methods

addGuide Adds a guide to the collection.
applyGuidesToAllOtherPages Resets all other pages’ guides to match the guides from the specified sourcePage.
beginInsertColumns
beginInsertRows
beginMoveColumns
beginMoveRows
beginRemoveColumns
beginRemoveRows
beginResetModel
blockSignals
buddy
canDropMimeData
canFetchMore
changePersistentIndex
changePersistentIndexList
childEvent
children
clear Removes all guides from the collection.
columnCount
connectNotify
createCommand
createIndex
customEvent
data
decodeData
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
guides Returns a list of all guides contained in the collection.
guidesOnPage Returns the list of guides contained on a matching page.
hasChildren
hasIndex
headerData
index
inherits
insertColumn
insertColumns
insertRow
insertRows
installEventFilter
isSignalConnected
isWidgetType
isWindowType
itemData
killTimer
layout
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.
readXml Sets the collection’s state from a DOM element.
receivers
removeColumn
removeColumns
removeEventFilter
removeGuide Removes the specified guide, and deletes it.
removeRow
removeRows
resetInternalData
revert
roleNames
rowCount
sender
senderSignalIndex
setData
setGuideLayoutPosition Sets the absolute position (in layout coordinates) for guide within the layout.
setHeaderData
setItemData
setObjectName
setParent
setProperty
setVisible Sets whether the guide lines should be visible.
sibling
signalsBlocked
sort
span
startTimer
stringType
submit
supportedDragActions
supportedDropActions
thread
timerEvent
tr
update Updates the position (and visibility) of all guide line items.
visible Returns true if the guide lines should be drawn.
writeXml Stores the collection’s state in a DOM element.

Attributes

HorizontalSortHint
LayoutPositionRole
NoLayoutChangeHint
OrientationRole
PageRole
PositionRole
UnitsRole
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
LayoutPositionRole = 260
OrientationRole = 256
PageRole = 259
PositionRole = 257
class Roles

Bases: int

UnitsRole = 258
addGuide(self, guide: QgsLayoutGuide)

Adds a guide to the collection. Ownership of the guide is transferred to the collection, and the guide will automatically have the correct layout set.

applyGuidesToAllOtherPages(self, sourcePage: int)

Resets all other pages’ guides to match the guides from the specified sourcePage.

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

Removes all guides from the collection.

See also

removeGuide()

columnCount(self, QModelIndex) → int
connectNotify()
createIndex()
customEvent()
data(self, index: QModelIndex, role: int) → Any
decodeData()
disconnectNotify()
encodeData()
endInsertColumns()
endInsertRows()
endMoveColumns()
endMoveRows()
endRemoveColumns()
endRemoveRows()
endResetModel()
flags(self, index: QModelIndex) → Qt.ItemFlags
guides(self) → object

Returns a list of all guides contained in the collection.

guides(self, orientation: Qt.Orientation, page: int = -1) -> List[QgsLayoutGuide] Returns the list of guides contained in the collection with the specified orientation and on a matching page. If page is -1, guides from all pages will be returned.

See also

guidesOnPage()

guidesOnPage(self, page: int) → List[QgsLayoutGuide]

Returns the list of guides contained on a matching page.

See also

guides()

headerData(self, section: int, orientation: Qt.Orientation, role: int = Qt.DisplayRole) → Any
isSignalConnected()
layout(self) → QgsLayout
persistentIndexList()
readXml(self, collectionElement: QDomElement, document: QDomDocument, context: QgsReadWriteContext) → bool

Sets the collection’s state from a DOM element. collectionElement is the DOM node corresponding to the collection.

See also

writeXml()

receivers()
removeGuide(self, guide: QgsLayoutGuide)

Removes the specified guide, and deletes it.

See also

clear()

removeRows(self, row: int, count: int, parent: QModelIndex = QModelIndex()) → bool
resetInternalData()
rowCount(self, QModelIndex) → int
sender()
senderSignalIndex()
setData(self, index: QModelIndex, value: Any, role: int) → bool
setGuideLayoutPosition(self, guide: QgsLayoutGuide, position: float)

Sets the absolute position (in layout coordinates) for guide within the layout.

setVisible(self, visible: bool)

Sets whether the guide lines should be visible.

See also

visible()

stringType(self) → str
timerEvent()
update(self)

Updates the position (and visibility) of all guide line items.

visible(self) → bool

Returns true if the guide lines should be drawn.

See also

setVisible()

writeXml(self, parentElement: QDomElement, document: QDomDocument, context: QgsReadWriteContext) → bool

Stores the collection’s state in a DOM element. The parentElement should refer to the parent layout’s DOM element.

See also

readXml()