QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
32 QDomElement elem3DMaps = element.firstChildElement( QStringLiteral(
"mapViewDocks3D" ) );
33 if ( !elem3DMaps.isNull() )
35 QDomElement elem3DMap = elem3DMaps.firstChildElement( QStringLiteral(
"view" ) );
36 while ( !elem3DMap.isNull() )
38 QString mapName = elem3DMap.attribute( QStringLiteral(
"name" ) );
39 m3DMapViewsDom.insert( mapName, elem3DMap );
41 elem3DMap = elem3DMap.nextSiblingElement( QStringLiteral(
"view" ) );
50 QDomElement dom = doc.createElement(
"mapViewDocks3D" );
51 for ( QDomElement d : m3DMapViewsDom.values() )
58 m3DMapViewsDom.clear();
64 return m3DMapViewsDom.value( name, QDomElement() );
69 return m3DMapViewsDom.values();
74 m3DMapViewsDom.insert( name, dom );
80 return m3DMapViewsDom.keys();
85 m3DMapViewsDom.remove( name );
91 QDomElement elem = m3DMapViewsDom.value( oldTitle );
92 m3DMapViewsDom.remove( oldTitle );
93 m3DMapViewsDom[ newTitle ] = elem;
94 m3DMapViewsDom[ newTitle ].setAttribute( QStringLiteral(
"name" ), newTitle );
100 if ( m3DMapViewsDom.contains( name ) )
102 m3DMapViewsDom[ name ].setAttribute( QStringLiteral(
"isOpen" ), visible );
108 return m3DMapViewsDom.value( name, QDomElement() ).attribute( QStringLiteral(
"isOpen" ), QStringLiteral(
"1" ) ).toInt() == 1;
void setPathResolver(const QgsPathResolver &resolver)
Sets up path resolver for conversion between relative and absolute paths.
void remove3DView(const QString &name)
Removes the configuration of the 3D view named name.
QList< QDomElement > get3DViews() const
Returns the list of configurations of 3D views added to the manager.
The class is used as a container of context for various read/write operations on other objects.
bool readXml(const QDomElement &element, const QDomDocument &doc)
Reads the manager's state from a DOM element, restoring all views present in the XML document.
static QgsProject * instance()
Returns the QgsProject singleton instance.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
bool is3DViewOpen(const QString &name)
Returns whether the 3D view named name will is opened.
void rename3DView(const QString &oldTitle, const QString &newTitle)
Renames the 3D view named oldTitle to newTitle.
void clear()
Removes and deletes all views from the manager.
QDomElement get3DViewSettings(const QString &name) const
Returns the DOM element representing the settings of the 3D view named name.
QStringList get3DViewsNames() const
Returns the names of all 3D views added to the manager.
void set3DViewInitiallyVisible(const QString &name, bool visible)
Sets whether the 3D view named name will be initially visible when the project is opened.
QgsMapViewsManager(QgsProject *project)
Constructor for QgsMapViewsManager.
void register3DViewSettings(const QString &name, const QDomElement &dom)
Adds a new 3D view named name to the manager with the configuration DOM dom.
void views3DListChanged()
Emitted when the views list has changed (whenever a view was removed, added, renamed....
QDomElement writeXml(QDomDocument &doc) const
Returns a DOM element representing the state of the manager.