Class: QgsMapViewsManager

Manages storage of a set of views.

QgsMapViewsManager handles the storage, serializing and deserializing of views. Usually this class is not constructed directly, but rather accessed through a QgsProject via QgsProject.viewsManager().

Added in version 3.24.

Class Hierarchy

Inheritance diagram of qgis.core.QgsMapViewsManager

Base classes

QObject

Methods

clear

Removes and deletes all views from the manager.

readXml

Reads the manager's state from a DOM element, restoring all views present in the XML document

remove3DView

Removes the configuration of the 3D view named name

rename3DView

Renames the 3D view named oldTitle to newTitle

writeXml

Returns a DOM element representing the state of the manager.

Signals

views3DListChanged

Emitted when the views list has changed (whenever a view was removed, added, renamed..)

class qgis.core.QgsMapViewsManager[source]

Bases: QObject

__init__(project: QgsProject | None)

Constructor for QgsMapViewsManager. The project will become the parent object for this manager.

Parameters:

project (Optional[QgsProject])

clear(self)[source]

Removes and deletes all views from the manager.

readXml(self, element: QDomElement, doc: QDomDocument) bool[source]

Reads the manager’s state from a DOM element, restoring all views present in the XML document

See also

writeXml()

Parameters:
  • element (QDomElement)

  • doc (QDomDocument)

Return type:

bool

remove3DView(self, name: str | None)[source]

Removes the configuration of the 3D view named name

Parameters:

name (Optional[str])

rename3DView(self, oldTitle: str | None, newTitle: str | None)[source]

Renames the 3D view named oldTitle to newTitle

Parameters:
  • oldTitle (Optional[str])

  • newTitle (Optional[str])

signal views3DListChanged[source]

Emitted when the views list has changed (whenever a view was removed, added, renamed..)

writeXml(self, doc: QDomDocument) QDomElement[source]

Returns a DOM element representing the state of the manager.

See also

readXml()

Parameters:

doc (QDomDocument)

Return type:

QDomElement