Class: QgsAbstractReportSection¶
- class qgis.core.QgsAbstractReportSection¶
Bases:
QgsAbstractLayoutIterator
An abstract base class for
QgsReport
subsections.Warning
This is not considered stable API, and may change in future QGIS releases. It is exposed to the Python bindings for unit testing purposes only.
QgsAbstractReportSection(parentSection:
QgsAbstractReportSection
= None) Constructor forQgsAbstractReportSection
, attached to the specifiedparent
section. Note that ownership is not transferred toparent
.Methods
Accepts the specified style entity
visitor
, causing it to visit all style entities associated with the report.Adds a child
section
, transferring ownership of the section to this section.- rtype:
bool
Returns the number of child sections for this report section.
Returns the child section at the specified
index
.Returns all child sections for this report section.
Clones the report section.
Returns the current context for this section.
Copies the common properties of a report section to a
destination
section.- rtype:
int
Returns a user-visible, translated description of the section.
- rtype:
bool
- param baseFilePath:
Returns the footer for the section.
Returns
True
if the footer for the section is enabled.Returns the header for the section.
Returns
True
if the header for the section is enabled.Returns an icon representing the section.
Inserts a child
section
at the specifiedindex
, transferring ownership of the section to this section.- rtype:
QgsLayout
- rtype:
bool
Returns the next body layout to export, or
None
if no body layout is required this iteration.Returns the parent report section.
Called just before rendering the section's footer.
Called just before rendering the section's header.
Returns the associated project.
Sets section state from a DOM element.
Sets the item state from a DOM element.
Refreshes the section when global layout related options change.
Removes a child
section
, deleting it.Removes the child section at the specified
index
, deleting it.Resets the section, ready for a new iteration.
Returns the row number of the section within it's parent section.
Sets the current
context
for this section.Sets the
footer
for the section.Sets whether the footer for the section is
enabled
.Sets the
header
for the section.Sets whether the header for the section is
enabled
.Sets the
parent
report section.Returns the section subclass type.
Stores section state within an XML DOM element.
Stores the section state in a DOM element.
Attributes
- Body = 1¶
- Children = 2¶
- End = 4¶
- Header = 0¶
- class SubSection¶
Bases:
int
- accept(self, visitor: QgsStyleEntityVisitorInterface) bool ¶
Accepts the specified style entity
visitor
, causing it to visit all style entities associated with the report.Returns
True
if the visitor should continue visiting other objects, orFalse
if visiting should be canceled.New in version 3.10.
- Parameters:
visitor (QgsStyleEntityVisitorInterface) –
- Return type:
bool
- appendChild(self, section: QgsAbstractReportSection)¶
Adds a child
section
, transferring ownership of the section to this section.See also
children()
See also
- Parameters:
section (QgsAbstractReportSection) –
- beginRender(self) bool ¶
- Return type:
bool
- childCount(self) int ¶
Returns the number of child sections for this report section. The child sections form the body of the report section.
See also
children()
- Return type:
int
- childSection(self, index: int) QgsAbstractReportSection ¶
Returns the child section at the specified
index
.See also
children()
- Parameters:
index (int) –
- Return type:
- childSections(self) List[QgsAbstractReportSection] ¶
Returns all child sections for this report section. The child sections form the body of the report section.
See also
See also
child()
See also
See also
See also
- Return type:
List[QgsAbstractReportSection]
- clone(self) QgsAbstractReportSection ¶
Clones the report section. Ownership of the returned section is transferred to the caller.
Subclasses should call
copyCommonProperties()
in theirclone()
implementations.- Return type:
- context(self) QgsReportSectionContext ¶
Returns the current context for this section.
See also
- Return type:
- copyCommonProperties(self, destination: QgsAbstractReportSection)¶
Copies the common properties of a report section to a
destination
section. This method should be called fromclone()
implementations.- Parameters:
destination (QgsAbstractReportSection) –
- count(self) int ¶
- Return type:
int
- description(self) str ¶
Returns a user-visible, translated description of the section.
- Return type:
str
- endRender(self) bool ¶
- Return type:
bool
- filePath(self, baseFilePath: str, extension: str) str ¶
- Parameters:
baseFilePath (str) –
extension (str) –
- Return type:
str
Returns the footer for the section. Note that the footer is only included if
footerEnabled()
isTrue
.See also
See also
See also
- Return type:
Returns
True
if the footer for the section is enabled.See also
See also
See also
- Return type:
bool
- header(self) QgsLayout ¶
Returns the header for the section. Note that the header is only included if
headerEnabled()
isTrue
.See also
See also
See also
- Return type:
- headerEnabled(self) bool ¶
Returns
True
if the header for the section is enabled.See also
See also
See also
- Return type:
bool
- icon(self) QIcon ¶
Returns an icon representing the section.
- Return type:
QIcon
- insertChild(self, index: int, section: QgsAbstractReportSection)¶
Inserts a child
section
at the specifiedindex
, transferring ownership of the section to this section.See also
children()
See also
- Parameters:
index (int) –
section (QgsAbstractReportSection) –
- next(self) bool ¶
- Return type:
bool
- nextBody(self) Tuple[QgsLayout, bool] ¶
Returns the next body layout to export, or
None
if no body layout is required this iteration.ok
will be set toFalse
if no bodies remain for this section.- Return type:
Tuple[
QgsLayout
, bool]
- parentSection(self) QgsAbstractReportSection ¶
Returns the parent report section.
- Return type:
Called just before rendering the section’s footer. Should return
True
if the footer is to be included for this section, orFalse
to skip the footerfor the current section.See also
- Return type:
bool
- prepareHeader(self) bool ¶
Called just before rendering the section’s header. Should return
True
if the header is to be included for this section, orFalse
to skip the header for the current section.See also
- Return type:
bool
- project(self) QgsProject ¶
Returns the associated project.
- Return type:
- readPropertiesFromElement(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool ¶
Sets section state from a DOM element.
See also
See also
- Parameters:
element (QDomElement) –
document (QDomDocument) –
context (QgsReadWriteContext) –
- Return type:
bool
- readXml(self, sectionElement: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool ¶
Sets the item state from a DOM element.
See also
- Parameters:
sectionElement (QDomElement) –
document (QDomDocument) –
context (QgsReadWriteContext) –
- Return type:
bool
- reloadSettings(self)¶
Refreshes the section when global layout related options change.
- removeChild(self, section: QgsAbstractReportSection)¶
Removes a child
section
, deleting it.See also
children()
- Parameters:
section (QgsAbstractReportSection) –
- removeChildAt(self, index: int)¶
Removes the child section at the specified
index
, deleting it.See also
children()
- Parameters:
index (int) –
- reset(self)¶
Resets the section, ready for a new iteration.
- row(self) int ¶
Returns the row number of the section within it’s parent section.
- Return type:
int
- setContext(self, context: QgsReportSectionContext)¶
Sets the current
context
for this section.See also
- Parameters:
context (QgsReportSectionContext) –
Sets the
footer
for the section. Note that the footer is only included iffooterEnabled()
isTrue
. Ownership offooter
is transferred to the report section.See also
See also
See also
- Parameters:
footer (QgsLayout) –
Sets whether the footer for the section is
enabled
.See also
See also
See also
- Parameters:
enabled (bool) –
- setHeader(self, header: QgsLayout)¶
Sets the
header
for the section. Note that the header is only included ifheaderEnabled()
isTrue
. Ownership ofheader
is transferred to the report section.See also
See also
See also
- Parameters:
header (QgsLayout) –
- setHeaderEnabled(self, enabled: bool)¶
Sets whether the header for the section is
enabled
.See also
See also
See also
- Parameters:
enabled (bool) –
- setParentSection(self, parent: QgsAbstractReportSection)¶
Sets the
parent
report section.- Parameters:
parent (QgsAbstractReportSection) –
- type(self) str ¶
Returns the section subclass type.
- Return type:
str
- writePropertiesToElement(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool ¶
Stores section state within an XML DOM element.
See also
See also
- Parameters:
element (QDomElement) –
document (QDomDocument) –
context (QgsReadWriteContext) –
- Return type:
bool
- writeXml(self, parentElement: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool ¶
Stores the section state in a DOM element.
See also
- Parameters:
parentElement (QDomElement) –
document (QDomDocument) –
context (QgsReadWriteContext) –
- Return type:
bool