Class: QgsLayoutGuideCollection¶
-
class
qgis.core.
QgsLayoutGuideCollection
(layout: QgsLayout, pageCollection: QgsLayoutPageCollection)¶ Bases:
PyQt5.QtCore.QAbstractTableModel
,qgis._core.QgsLayoutSerializableObject
Constructor for QgsLayoutGuideCollection belonging to the specified layout, and linked to the specified
pageCollection
.Stores and manages the snap guides used by a layout.
New in version 3.0: Enums
Methods
Adds a
guide
to the collection.Resets all other pages’ guides to match the guides from the specified
sourcePage
.Removes all guides from the collection.
Returns a list of all guides contained in the collection.
Returns the list of guides contained on a matching
page
.Sets the collection’s state from a DOM element.
Removes the specified
guide
, and deletes it.Sets the absolute
position
(in layout coordinates) forguide
within the layout.Sets whether the guide lines should be
visible
.Updates the position (and visibility) of all guide line items.
Returns true if the guide lines should be drawn.
Stores the collection’s state in a DOM element.
Signals
Attributes
-
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
-
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 matchingpage
. Ifpage
is -1, guides from all pages will be returned.See also
-
guidesOnPage
(self, page: int) → List[QgsLayoutGuide]¶ Returns the list of guides contained on a matching
page
.See also
-
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
-
receivers
()¶
-
removeGuide
(self, guide: QgsLayoutGuide)¶ Removes the specified
guide
, and deletes it.See also
-
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) forguide
within the layout.
-
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
-