Class: QgisInterface

class qgis.gui.QgisInterface

Bases: PyQt5.QtCore.QObject

Abstract base class defining interfaces exposed by QgisApp and made available to plugins.

Only functionality exposed by QgisInterface can be used in plugins. This interface has to be implemented with application specific details.

QGIS implements it in QgisAppInterface class, 3rd party applications could provide their own implementation to be able to use plugins.

QgisInterface() Constructor

Methods

actionAbout

rtype:

Optional[QAction]

actionAddAfsLayer

Returns the native Add ArcGIS REST Server action.

actionAddAllToOverview

rtype:

Optional[QAction]

actionAddAmsLayer

Returns the native Add ArcGIS REST Server action.

actionAddFeature

Returns the native Add Feature action.

actionAddOgrLayer

rtype:

Optional[QAction]

actionAddPart

Returns the native Add Part action.

actionAddPgLayer

rtype:

Optional[QAction]

actionAddPointCloudLayer

Returns the native Add Point Cloud Layer action.

actionAddRasterLayer

rtype:

Optional[QAction]

actionAddRing

Returns the native Add Ring action.

actionAddToOverview

rtype:

Optional[QAction]

actionAddVectorTileLayer

Returns the native Add Vector Tile Layer action.

actionAddWmsLayer

rtype:

Optional[QAction]

actionAddXyzLayer

Returns the native Add XYZ Layer action.

actionAllEdits

rtype:

Optional[QAction]

actionCancelAllEdits

rtype:

Optional[QAction]

actionCancelEdits

rtype:

Optional[QAction]

actionCheckQgisVersion

rtype:

Optional[QAction]

actionCircle2Points

Returns the native add circle from 2 points action.

actionCircle2TangentsPoint

Returns the native add circle from 2 tangents and a point action.

actionCircle3Points

Returns the native add circle from 3 points action.

actionCircle3Tangents

Returns the native add circle from 3 tangents action.

actionCircleCenterPoint

Returns the native add circle from center action.

actionCopyFeatures

Returns the native Copy Features action.

actionCopyLayerStyle

rtype:

Optional[QAction]

actionCreatePrintLayout

Create new print layout action

actionCustomProjection

rtype:

Optional[QAction]

actionCutFeatures

Returns the native Cut Features action.

actionDeletePart

Returns the native Delete Part action.

actionDeleteRing

Returns the native Delete Ring action.

actionDeleteSelected

Returns the native Delete Selected Features action.

actionDraw

Returns the native draw action.

actionDuplicateLayer

rtype:

Optional[QAction]

actionEllipseCenter2Points

Returns the native add ellipse from center and 2 points action.

actionEllipseCenterPoint

Returns the native add ellipse from center and a point action.

actionEllipseExtent

Returns the native add ellipse from an extent action.

actionEllipseFoci

Returns the native add ellipse from foci action.

actionExit

Returns the Exit QGIS action.

actionFeatureAction

Returns the native run action feature action.

actionHelpContents

rtype:

Optional[QAction]

actionHideAllLayers

rtype:

Optional[QAction]

actionHideDeselectedLayers

Returns the Hide Deselected Layers action.

actionHideSelectedLayers

rtype:

Optional[QAction]

actionIdentify

Returns the native identify action.

actionLayerProperties

rtype:

Optional[QAction]

actionLayerSaveAs

rtype:

Optional[QAction]

actionManagePlugins

rtype:

Optional[QAction]

actionMapTips

Returns the native map tips action.

actionMeasure

Returns the native measure action.

actionMeasureArea

Returns the native measure area action.

actionMoveFeature

Returns the native Move Features action.

actionNewBookmark

Returns the native new bookmark action.

actionNewProject

Returns the native New Project action.

actionNewVectorLayer

rtype:

Optional[QAction]

actionOpenFieldCalculator

rtype:

Optional[QAction]

actionOpenProject

Returns the Open Project action.

actionOpenStatisticalSummary

Statistical summary action.

actionOpenTable

rtype:

Optional[QAction]

actionOptions

rtype:

Optional[QAction]

actionPan

Returns the native pan action.

actionPanToSelected

Returns the native pan to selected action.

actionPasteFeatures

Returns the native Paste Features action.

actionPasteLayerStyle

rtype:

Optional[QAction]

actionPluginListSeparator

rtype:

Optional[QAction]

actionProjectProperties

Returns the native Project Properties action.

actionQgisHomePage

rtype:

Optional[QAction]

actionRectangle3PointsDistance

Returns the native add rectangle from 3 points (distance from 2nd and 3rd points) action.

actionRectangle3PointsProjected

Returns the native add rectangle from 3 points (distance from projected 3rd point on segment p1 and p2) action.

actionRectangleCenterPoint

Returns the native add rectangle from center and a point action.

actionRectangleExtent

Returns the native add rectangle from extent action.

actionRegularPolygon2Points

Returns the native add regular polygon from 2 points action.

actionRegularPolygonCenterCorner

Returns the native add regular polygon from center and a corner action.

actionRegularPolygonCenterPoint

Returns the native add regular polygon from center and a point action.

actionRemoveAllFromOverview

rtype:

Optional[QAction]

actionRollbackAllEdits

rtype:

Optional[QAction]

actionRollbackEdits

rtype:

Optional[QAction]

actionSaveActiveLayerEdits

rtype:

Optional[QAction]

actionSaveAllEdits

rtype:

Optional[QAction]

actionSaveEdits

rtype:

Optional[QAction]

actionSaveMapAsImage

Returns the native Save Map as Image action.

actionSaveProject

Returns the native Save Project action.

actionSaveProjectAs

Returns the native Save Project As action.

actionSelect

Returns the native select action.

actionSelectFreehand

Returns the native select freehand action.

actionSelectPolygon

Returns the native select polygon action.

actionSelectRadius

Returns the native select radius action.

actionSelectRectangle

Returns the native select rectangle action.

actionShowAllLayers

rtype:

Optional[QAction]

actionShowBookmarks

Returns the native show bookmarks action.

actionShowLayoutManager

Show layout manager action

actionShowPythonDialog

rtype:

Optional[QAction]

actionShowSelectedLayers

rtype:

Optional[QAction]

actionSimplifyFeature

Returns the native Simplify/Smooth Features action.

actionSplitFeatures

Returns the native Split Features action.

actionSplitParts

Returns the native Split Parts action.

actionToggleEditing

rtype:

Optional[QAction]

actionToggleFullScreen

rtype:

Optional[QAction]

actionToggleSelectedLayers

Returns the Toggle Selected Layers action.

actionToggleSelectedLayersIndependently

Returns the Toggle Selected Layers Independently action.

actionVertexTool

Returns the native "Vertex Tool for All Layers" action.

actionVertexToolActiveLayer

Returns the native "Vertex Tool for Active Layer" action.

actionZoomActualSize

Returns the native zoom resolution (100%) action.

actionZoomFullExtent

Returns the native zoom full extent action.

actionZoomIn

Returns the native zoom in action.

actionZoomLast

Returns the native zoom last action.

actionZoomNext

Returns the native zoom next action.

actionZoomOut

Returns the native zoom out action.

actionZoomToLayer

Returns the native zoom to layer action.

actionZoomToLayers

Returns the native zoom to layers action.

actionZoomToSelected

Returns the native zoom to selected action.

activeDecorations

Returns a list of the active decorations.

activeLayer

Returns a pointer to the active layer (layer selected in the legend)

addCustomActionForLayer

Add action to context menu for a specific layer in the layer tree.

addCustomActionForLayerType

Add action to context menu for layers in the layer tree.

addDatabaseToolBarIcon

Add an icon to the Database toolbar

addDatabaseToolBarWidget

Add a widget to the database toolbar.

addDockWidget

Adds a dock widget to the main window, in the specified dock area.

addLayerMenu

Returns a reference to the main window "Add Layer" menu.

addMeshLayer

Adds a mesh layer to the current project, using the specified data provider and source url.

addPluginToDatabaseMenu

Add action to the Database menu

addPluginToMenu

Add action to the plugins menu

addPluginToMeshMenu

Add action to the Mesh menu

addPluginToRasterMenu

Add action to the Raster menu

addPluginToVectorMenu

Add action to the Vector menu

addPluginToWebMenu

Add action to the Web menu

addPointCloudLayer

Adds a point cloud layer to the current project, using the specified data provider and source url.

addProject

Adds (opens) a project

addProjectExportAction

Adds an action to the QGIS "Export project" menu.

addProjectImportAction

Adds an action to the QGIS "Import project" menu.

addRasterLayer

Adds a raster layer to the current project, given a raster layer file name.

addRasterToolBarIcon

Add an icon to the Raster toolbar

addRasterToolBarWidget

Add a widget to the raster toolbar.

addTabifiedDockWidget

Add a dock widget to the given area and tabify it (if other dock widgets exist in the same area).

addTiledSceneLayer

Adds a tiled scene layer to the current project, using the specified data provider and source url.

addToolBar

Add toolbar with specified name

addToolBarIcon

Add an icon to the plugins toolbar

addToolBarWidget

Add a widget to the plugins toolbar.

addUserInputWidget

Adds a widget to the user input tool bar.

addVectorLayer

Adds a vector layer to the current project, using the specified data provider and source url.

addVectorTileLayer

Adds a vector tile layer to the current project, using the specified source url.

addVectorToolBarIcon

Add an icon to the Vector toolbar

addVectorToolBarWidget

Add a widget to the vector toolbar.

addWebToolBarIcon

Add an icon to the Web toolbar

addWebToolBarWidget

Add a widget to the web toolbar.

addWindow

Add window to Window menu.

advancedDigitizeToolBar

Returns a reference to the main window "Advanced Digitizing" toolbar.

askForDatumTransform

Checks available datum transforms and ask user if several are available and none is chosen.

attributesToolBar

Returns a reference to the main window "Attributes" toolbar.

blockActiveLayerChanges

Sets whether changes to the active layer should be temporarily blocked.

browserModel

Returns the application browser model.

buildStyleSheet

Generate stylesheet

cadDockWidget

Advanced digitizing dock widget

childEvent

closeMapCanvas

Closes the additional map canvas with matching name.

closeMapCanvas3D

Closes the additional map canvas with matching name.

connectNotify

copySelectionToClipboard

Copy selected features from the layer to clipboard

createNewMapCanvas

Create a new map canvas with the specified unique name.

createNewMapCanvas3D

Create a new 3D map canvas with the specified unique name.

customEvent

dataSourceManagerToolBar

Returns a reference to the main window "Data Source Manager" toolbar.

databaseMenu

Returns a reference to the main window "Database" menu.

databaseToolBar

Returns a reference to the main window "Database" toolbar.

defaultStyleSheetFont

Returns a reference font for initial qApp (may not be same as QgisApp)

defaultStyleSheetOptions

Returns changeable options built from settings and/or defaults

deregisterLocatorFilter

Deregisters a locator filter from the app's locator bar and deletes it.

digitizeToolBar

Returns a reference to the main window "Digitize" toolbar.

disconnectNotify

editMenu

Returns a reference to the main window "Edit" menu.

editableLayers

Returns vector layers in edit mode

fileToolBar

Returns a reference to the main window "File" toolbar.

firstRightStandardMenu

Returns a reference to the right most standard menu, which is usually the last menu item before the "Help" menu.

getFeatureForm

Returns a feature form for a given feature.

helpMenu

Returns a reference to the main window "Help" menu.

helpToolBar

Returns a reference to the main window "Help" toolbar.

iconSize

Returns the toolbar icon size.

insertAddLayerAction

Add "add layer" action to layer menu

invalidateLocatorResults

Invalidate results from the locator filter.

isSignalConnected

layerMenu

Returns a reference to the main window "Layer" menu.

layerToolBar

Returns a reference to the main window "Layer" toolbar.

layerTreeCanvasBridge

Returns a pointer to the layer tree canvas bridge

layerTreeInsertionPoint

Returns the insertion point.

layerTreeView

rtype:

Optional[QgsLayerTreeView]

locatorSearch

This will perform a search in the locator bar by setting the line edit text to searchText and automatically displaying any results.

mainWindow

Returns a pointer to the main window (instance of QgisApp in case of QGIS)

mapCanvas

Returns a pointer to the map canvas

mapCanvases

Returns a list of all map canvases open in the app.

mapCanvases3D

Returns a list of all 3D map canvases open in the app.

mapNavToolToolBar

Returns a reference to the main window "Map Navigation" toolbar.

mapToolActionGroup

Returns the action group for map tools.

meshMenu

Returns a reference to the main window "Mesh" menu.

messageBar

Returns the message bar of the main app

messageTimeout

Returns the timeout for timed messages: default of 5 seconds

newLayerMenu

Returns a reference to the main window "Create New Layer" menu.

newProject

Starts a new blank project.

openDataSourceManagerPage

Opens a page in the main window "Data Source Manager" dialog.

openFeatureForm

Opens a new feature form.

openLayoutDesigner

Opens a new layout designer dialog for the specified layout, or brings an already open designer window to the foreground if one is already created for the layout.

openLayoutDesigners

Returns all currently open layout designers.

openMessageLog

Opens the message log dock widget.

openURL

Open a url in the users browser.

pasteFromClipboard

Paste features from clipboard to the layer

pluginHelpMenu

Returns a reference to the main window "Plugin Help" sub-menu.

pluginManagerInterface

rtype:

Optional[QgsPluginManagerInterface]

pluginMenu

Returns a reference to the main window "Plugin" menu.

pluginToolBar

Returns a reference to the main window "Plugin" toolbar.

preloadForm

This method is only needed when using a UI form with a custom widget plugin and calling openFeatureForm or getFeatureForm from Python (PyQt) and you haven't used the info tool first.

projectImportExportMenu

Returns a reference to the main window "Import/Export" project menu.

projectMenu

Returns a reference to the main window "Project" menu.

rasterMenu

Returns a reference to the main window "Raster" menu.

rasterToolBar

Returns a reference to the main window "Raster" toolbar.

receivers

registerApplicationExitBlocker

Register a new application exit blocker, which can be used to prevent the QGIS application from exiting while a plugin or script has unsaved changes.

registerCustomDropHandler

Register a new custom drop handler.

registerCustomLayoutDropHandler

Register a new custom drop handler for layout windows.

registerCustomProjectOpenHandler

Register a new custom project open handler.

registerDevToolWidgetFactory

Register a new tool in the development/debugging tools dock.

registerLocatorFilter

Registers a locator filter for the app's locator bar.

registerMainWindowAction

Register action to the shortcuts manager so its shortcut can be changed in GUI

registerMapLayerConfigWidgetFactory

Register a new tab in the map layer properties dialog.

registerMapToolHandler

Register a new application map tool handler, which can be used to automatically setup all connections and logic required to switch to a custom map tool whenever the state of the QGIS application permits.

registerOptionsWidgetFactory

Register a new tab in the options dialog.

registerProjectPropertiesWidgetFactory

Register a new tab in the project properties dialog.

reloadConnections

Triggered when connections have changed.

removeAddLayerAction

Remove "add layer" action from layer menu

removeCustomActionForLayerType

Remove action for layers in the layer tree previously added with addCustomActionForLayerType()

removeDatabaseToolBarIcon

Remove an action (icon) from the Database toolbar

removeDockWidget

Removes the specified dock widget from main window (without deleting it).

removePluginDatabaseMenu

Remove action from the Database menu

removePluginMenu

Remove action from the plugins menu

removePluginMeshMenu

Remove action from the Mesh menu

removePluginRasterMenu

Remove action from the Raster menu

removePluginVectorMenu

Remove action from the Vector menu

removePluginWebMenu

Remove action from the Web menu

removeProjectExportAction

Adds an action to the QGIS "Export project" menu.

removeProjectImportAction

Adds an action to the QGIS "Import project" menu.

removeRasterToolBarIcon

Remove an action (icon) from the Raster toolbar

removeToolBarIcon

Remove an action (icon) from the plugin toolbar

removeVectorToolBarIcon

Remove an action (icon) from the Vector toolbar

removeWebToolBarIcon

Remove an action (icon) from the Web toolbar

removeWindow

Remove window from Window menu.

saveStyleSheetOptions

Save changed default option keys/values to user settings

selectionToolBar

Returns a reference to the main window "Selection" toolbar.

sender

senderSignalIndex

setActiveLayer

Set the active layer (layer gets selected in the legend) returns True if the layer exists, False otherwise

setGpsPanelConnection

Sets a GPS connection to use within the GPS Panel widget.

settingsMenu

Returns a reference to the main window "Settings" menu.

shapeDigitizeToolBar

Returns a reference to the main window "Shape Digitizing" toolbar.

showAttributeTable

Open attribute table dialog

showLayerProperties

Opens layer properties dialog for the layer l.

showLayoutManager

Opens the layout manager dialog.

showOptionsDialog

Opens the options dialog.

showProjectPropertiesDialog

Opens the project properties dialog.

statusBarIface

Returns a pointer to the app's status bar interface.

takeAppScreenShots

Take screenshots for user documentation

timerEvent

unregisterApplicationExitBlocker

Unregister a previously registered application exit blocker.

unregisterCustomDropHandler

Unregister a previously registered custom drop handler.

unregisterCustomLayoutDropHandler

Unregister a previously registered custom drop handler for layout windows.

unregisterCustomProjectOpenHandler

Unregister a previously registered custom project open handler.

unregisterDevToolWidgetFactory

Unregister a previously registered tool factory from the development/debugging tools dock.

unregisterMainWindowAction

Unregister a previously registered action.

unregisterMapLayerConfigWidgetFactory

Unregister a previously registered tab in the map layer properties dialog.

unregisterMapToolHandler

Unregister a previously registered map tool handler.

unregisterOptionsWidgetFactory

Unregister a previously registered tab in the options dialog.

unregisterProjectPropertiesWidgetFactory

Unregister a previously registered tab in the options dialog.

userProfileManager

Returns a reference to the user profile manager

vectorLayerTools

Access the vector layer tools instance.

vectorMenu

Returns a reference to the main window "Vector" menu.

vectorToolBar

Returns a reference to the main window "Vector" toolbar.

viewMenu

Returns a reference to the main window "View" menu.

webMenu

Returns a reference to the main window "Web" menu.

webToolBar

Returns a reference to the main window "Web" toolbar.

windowMenu

Returns a reference to the main window "Window" menu.

zoomFull

Zooms to the full extent of all map layers.

zoomToActiveLayer

Zooms to extent of the active layer.

zoomToNext

Zooms to the next view extent.

zoomToPrevious

Zooms to the previous view extent.

Signals

currentLayerChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

currentThemeChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

initializationCompleted

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

layerSavedAs

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

layoutDesignerClosed

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

layoutDesignerOpened

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

layoutDesignerWillBeClosed

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

newProjectCreated

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

projectRead

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

actionAbout(self) QAction | None
Return type:

Optional[QAction]

actionAddAfsLayer(self) QAction | None

Returns the native Add ArcGIS REST Server action.

Return type:

Optional[QAction]

actionAddAllToOverview(self) QAction | None
Return type:

Optional[QAction]

actionAddAmsLayer(self) QAction | None

Returns the native Add ArcGIS REST Server action.

Return type:

Optional[QAction]

actionAddFeature(self) QAction | None

Returns the native Add Feature action.

Return type:

Optional[QAction]

actionAddOgrLayer(self) QAction | None
Return type:

Optional[QAction]

actionAddPart(self) QAction | None

Returns the native Add Part action.

Return type:

Optional[QAction]

actionAddPgLayer(self) QAction | None
Return type:

Optional[QAction]

actionAddPointCloudLayer(self) QAction | None

Returns the native Add Point Cloud Layer action.

Added in version 3.18.

Return type:

Optional[QAction]

actionAddRasterLayer(self) QAction | None
Return type:

Optional[QAction]

actionAddRing(self) QAction | None

Returns the native Add Ring action.

Return type:

Optional[QAction]

actionAddToOverview(self) QAction | None
Return type:

Optional[QAction]

actionAddVectorTileLayer(self) QAction | None

Returns the native Add Vector Tile Layer action.

Added in version 3.14.

Return type:

Optional[QAction]

actionAddWmsLayer(self) QAction | None
Return type:

Optional[QAction]

actionAddXyzLayer(self) QAction | None

Returns the native Add XYZ Layer action.

Added in version 3.14.

Return type:

Optional[QAction]

actionAllEdits(self) QAction | None
Return type:

Optional[QAction]

actionCancelAllEdits(self) QAction | None
Return type:

Optional[QAction]

actionCancelEdits(self) QAction | None
Return type:

Optional[QAction]

actionCheckQgisVersion(self) QAction | None
Return type:

Optional[QAction]

actionCircle2Points(self) QAction | None

Returns the native add circle from 2 points action. Call trigger() on it to set the map tool.

Deprecated since version QGIS: 3.26 shape digitizing is now part of the add feature tool. To enable the shape tool, use QgsMapToolCapture.setCurrentCaptureTechnique() and then QgsMapToolCapture.setCurrentShapeMapTool().

Return type:

Optional[QAction]

actionCircle2TangentsPoint(self) QAction | None

Returns the native add circle from 2 tangents and a point action. Call trigger() on it to set the map tool.

Deprecated since version QGIS: 3.26 shape digitizing is now part of the add feature tool. To enable the shape tool, use QgsMapToolCapture.setCurrentCaptureTechnique() and then QgsMapToolCapture.setCurrentShapeMapTool().

Return type:

Optional[QAction]

actionCircle3Points(self) QAction | None

Returns the native add circle from 3 points action. Call trigger() on it to set the map tool.

Deprecated since version QGIS: 3.26 shape digitizing is now part of the add feature tool. To enable the shape tool, use QgsMapToolCapture.setCurrentCaptureTechnique() and then QgsMapToolCapture.setCurrentShapeMapTool().

Return type:

Optional[QAction]

actionCircle3Tangents(self) QAction | None

Returns the native add circle from 3 tangents action. Call trigger() on it to set the map tool.

Deprecated since version QGIS: 3.26 shape digitizing is now part of the add feature tool. To enable the shape tool, use QgsMapToolCapture.setCurrentCaptureTechnique() and then QgsMapToolCapture.setCurrentShapeMapTool().

Return type:

Optional[QAction]

actionCircleCenterPoint(self) QAction | None

Returns the native add circle from center action. Call trigger() on it to set the map tool.

Deprecated since version QGIS: 3.26 shape digitizing is now part of the add feature tool. To enable the shape tool, use QgsMapToolCapture.setCurrentCaptureTechnique() and then QgsMapToolCapture.setCurrentShapeMapTool().

Return type:

Optional[QAction]

actionCopyFeatures(self) QAction | None

Returns the native Copy Features action.

Return type:

Optional[QAction]

actionCopyLayerStyle(self) QAction | None
Return type:

Optional[QAction]

actionCreatePrintLayout(self) QAction | None

Create new print layout action

Return type:

Optional[QAction]

actionCustomProjection(self) QAction | None
Return type:

Optional[QAction]

actionCutFeatures(self) QAction | None

Returns the native Cut Features action.

Return type:

Optional[QAction]

actionDeletePart(self) QAction | None

Returns the native Delete Part action.

Return type:

Optional[QAction]

actionDeleteRing(self) QAction | None

Returns the native Delete Ring action.

Return type:

Optional[QAction]

actionDeleteSelected(self) QAction | None

Returns the native Delete Selected Features action.

Return type:

Optional[QAction]

actionDraw(self) QAction | None

Returns the native draw action.

Return type:

Optional[QAction]

actionDuplicateLayer(self) QAction | None
Return type:

Optional[QAction]

actionEllipseCenter2Points(self) QAction | None

Returns the native add ellipse from center and 2 points action. Call trigger() on it to set the map tool.

Deprecated since version QGIS: 3.26 shape digitizing is now part of the add feature tool. To enable the shape tool, use QgsMapToolCapture.setCurrentCaptureTechnique() and then QgsMapToolCapture.setCurrentShapeMapTool().

Return type:

Optional[QAction]

actionEllipseCenterPoint(self) QAction | None

Returns the native add ellipse from center and a point action. Call trigger() on it to set the map tool.

Deprecated since version QGIS: 3.26 shape digitizing is now part of the add feature tool. To enable the shape tool, use QgsMapToolCapture.setCurrentCaptureTechnique() and then QgsMapToolCapture.setCurrentShapeMapTool().

Return type:

Optional[QAction]

actionEllipseExtent(self) QAction | None

Returns the native add ellipse from an extent action. Call trigger() on it to set the map tool.

Deprecated since version QGIS: 3.26 shape digitizing is now part of the add feature tool. To enable the shape tool, use QgsMapToolCapture.setCurrentCaptureTechnique() and then QgsMapToolCapture.setCurrentShapeMapTool().

Return type:

Optional[QAction]

actionEllipseFoci(self) QAction | None

Returns the native add ellipse from foci action. Call trigger() on it to set the map tool.

Deprecated since version QGIS: 3.26 shape digitizing is now part of the add feature tool. To enable the shape tool, use QgsMapToolCapture.setCurrentCaptureTechnique() and then QgsMapToolCapture.setCurrentShapeMapTool().

Return type:

Optional[QAction]

actionExit(self) QAction | None

Returns the Exit QGIS action.

Return type:

Optional[QAction]

actionFeatureAction(self) QAction | None

Returns the native run action feature action. Call trigger() on it to set the default run feature action map tool.

Return type:

Optional[QAction]

actionHelpContents(self) QAction | None
Return type:

Optional[QAction]

actionHideAllLayers(self) QAction | None
Return type:

Optional[QAction]

actionHideDeselectedLayers(self) QAction | None

Returns the Hide Deselected Layers action.

Return type:

Optional[QAction]

actionHideSelectedLayers(self) QAction | None
Return type:

Optional[QAction]

actionIdentify(self) QAction | None

Returns the native identify action. Call trigger() on it to set the default identify map tool.

Return type:

Optional[QAction]

actionLayerProperties(self) QAction | None
Return type:

Optional[QAction]

actionLayerSaveAs(self) QAction | None
Return type:

Optional[QAction]

actionManagePlugins(self) QAction | None
Return type:

Optional[QAction]

actionMapTips(self) QAction | None

Returns the native map tips action. Call trigger() on it to toggle map tips.

Return type:

Optional[QAction]

actionMeasure(self) QAction | None

Returns the native measure action. Call trigger() on it to set the default measure map tool.

Return type:

Optional[QAction]

actionMeasureArea(self) QAction | None

Returns the native measure area action. Call trigger() on it to set the default measure area map tool.

Return type:

Optional[QAction]

actionMoveFeature(self) QAction | None

Returns the native Move Features action.

Return type:

Optional[QAction]

actionNewBookmark(self) QAction | None

Returns the native new bookmark action. Call trigger() on it to open the new bookmark dialog.

Return type:

Optional[QAction]

actionNewProject(self) QAction | None

Returns the native New Project action.

Return type:

Optional[QAction]

actionNewVectorLayer(self) QAction | None
Return type:

Optional[QAction]

actionOpenFieldCalculator(self) QAction | None
Return type:

Optional[QAction]

actionOpenProject(self) QAction | None

Returns the Open Project action.

Return type:

Optional[QAction]

actionOpenStatisticalSummary(self) QAction | None

Statistical summary action.

Return type:

Optional[QAction]

actionOpenTable(self) QAction | None
Return type:

Optional[QAction]

actionOptions(self) QAction | None
Return type:

Optional[QAction]

actionPan(self) QAction | None

Returns the native pan action. Call trigger() on it to set the default pan map tool.

Return type:

Optional[QAction]

actionPanToSelected(self) QAction | None

Returns the native pan to selected action. Call trigger() on it to pan the map canvas to the selection.

Return type:

Optional[QAction]

actionPasteFeatures(self) QAction | None

Returns the native Paste Features action.

Return type:

Optional[QAction]

actionPasteLayerStyle(self) QAction | None
Return type:

Optional[QAction]

actionPluginListSeparator(self) QAction | None
Return type:

Optional[QAction]

actionProjectProperties(self) QAction | None

Returns the native Project Properties action.

Return type:

Optional[QAction]

actionQgisHomePage(self) QAction | None
Return type:

Optional[QAction]

actionRectangle3PointsDistance(self) QAction | None

Returns the native add rectangle from 3 points (distance from 2nd and 3rd points) action. Call trigger() on it to set the map tool.

Deprecated since version QGIS: 3.26 shape digitizing is now part of the add feature tool. To enable the shape tool, use QgsMapToolCapture.setCurrentCaptureTechnique() and then QgsMapToolCapture.setCurrentShapeMapTool().

Return type:

Optional[QAction]

actionRectangle3PointsProjected(self) QAction | None

Returns the native add rectangle from 3 points (distance from projected 3rd point on segment p1 and p2) action. Call trigger() on it to set the map tool.

Deprecated since version QGIS: 3.26 shape digitizing is now part of the add feature tool. To enable the shape tool, use QgsMapToolCapture.setCurrentCaptureTechnique() and then QgsMapToolCapture.setCurrentShapeMapTool().

Return type:

Optional[QAction]

actionRectangleCenterPoint(self) QAction | None

Returns the native add rectangle from center and a point action. Call trigger() on it to set the map tool.

Deprecated since version QGIS: 3.26 shape digitizing is now part of the add feature tool. To enable the shape tool, use QgsMapToolCapture.setCurrentCaptureTechnique() and then QgsMapToolCapture.setCurrentShapeMapTool().

Return type:

Optional[QAction]

actionRectangleExtent(self) QAction | None

Returns the native add rectangle from extent action. Call trigger() on it to set the map tool.

Deprecated since version QGIS: 3.26 shape digitizing is now part of the add feature tool. To enable the shape tool, use QgsMapToolCapture.setCurrentCaptureTechnique() and then QgsMapToolCapture.setCurrentShapeMapTool().

Return type:

Optional[QAction]

actionRegularPolygon2Points(self) QAction | None

Returns the native add regular polygon from 2 points action. Call trigger() on it to set the map tool.

Deprecated since version QGIS: 3.26 shape digitizing is now part of the add feature tool. To enable the shape tool, use QgsMapToolCapture.setCurrentCaptureTechnique() and then QgsMapToolCapture.setCurrentShapeMapTool().

Return type:

Optional[QAction]

actionRegularPolygonCenterCorner(self) QAction | None

Returns the native add regular polygon from center and a corner action. Call trigger() on it to set the map tool.

Deprecated since version QGIS: 3.26 shape digitizing is now part of the add feature tool. To enable the shape tool, use QgsMapToolCapture.setCurrentCaptureTechnique() and then QgsMapToolCapture.setCurrentShapeMapTool().

Return type:

Optional[QAction]

actionRegularPolygonCenterPoint(self) QAction | None

Returns the native add regular polygon from center and a point action. Call trigger() on it to set the map tool.

Deprecated since version QGIS: 3.26 shape digitizing is now part of the add feature tool. To enable the shape tool, use QgsMapToolCapture.setCurrentCaptureTechnique() and then QgsMapToolCapture.setCurrentShapeMapTool().

Return type:

Optional[QAction]

actionRemoveAllFromOverview(self) QAction | None
Return type:

Optional[QAction]

actionRollbackAllEdits(self) QAction | None
Return type:

Optional[QAction]

actionRollbackEdits(self) QAction | None
Return type:

Optional[QAction]

actionSaveActiveLayerEdits(self) QAction | None
Return type:

Optional[QAction]

actionSaveAllEdits(self) QAction | None
Return type:

Optional[QAction]

actionSaveEdits(self) QAction | None
Return type:

Optional[QAction]

actionSaveMapAsImage(self) QAction | None

Returns the native Save Map as Image action.

Return type:

Optional[QAction]

actionSaveProject(self) QAction | None

Returns the native Save Project action.

Return type:

Optional[QAction]

actionSaveProjectAs(self) QAction | None

Returns the native Save Project As action.

Return type:

Optional[QAction]

actionSelect(self) QAction | None

Returns the native select action. Call trigger() on it to set the default select map tool.

Return type:

Optional[QAction]

actionSelectFreehand(self) QAction | None

Returns the native select freehand action. Call trigger() on it to set the default select freehand map tool.

Return type:

Optional[QAction]

actionSelectPolygon(self) QAction | None

Returns the native select polygon action. Call trigger() on it to set the default select polygon map tool.

Return type:

Optional[QAction]

actionSelectRadius(self) QAction | None

Returns the native select radius action. Call trigger() on it to set the default select radius map tool.

Return type:

Optional[QAction]

actionSelectRectangle(self) QAction | None

Returns the native select rectangle action. Call trigger() on it to set the default select rectangle map tool.

Return type:

Optional[QAction]

actionShowAllLayers(self) QAction | None
Return type:

Optional[QAction]

actionShowBookmarks(self) QAction | None

Returns the native show bookmarks action. Call trigger() on it to open the bookmarks dialog.

Return type:

Optional[QAction]

actionShowLayoutManager(self) QAction | None

Show layout manager action

Return type:

Optional[QAction]

actionShowPythonDialog(self) QAction | None
Return type:

Optional[QAction]

actionShowSelectedLayers(self) QAction | None
Return type:

Optional[QAction]

actionSimplifyFeature(self) QAction | None

Returns the native Simplify/Smooth Features action.

Return type:

Optional[QAction]

actionSplitFeatures(self) QAction | None

Returns the native Split Features action.

Return type:

Optional[QAction]

actionSplitParts(self) QAction | None

Returns the native Split Parts action.

Return type:

Optional[QAction]

actionToggleEditing(self) QAction | None
Return type:

Optional[QAction]

actionToggleFullScreen(self) QAction | None
Return type:

Optional[QAction]

actionToggleSelectedLayers(self) QAction | None

Returns the Toggle Selected Layers action.

Added in version 3.14.

Return type:

Optional[QAction]

actionToggleSelectedLayersIndependently(self) QAction | None

Returns the Toggle Selected Layers Independently action.

Added in version 3.14.

Return type:

Optional[QAction]

actionVertexTool(self) QAction | None

Returns the native “Vertex Tool for All Layers” action.

Return type:

Optional[QAction]

actionVertexToolActiveLayer(self) QAction | None

Returns the native “Vertex Tool for Active Layer” action.

Added in version 3.6.

Return type:

Optional[QAction]

actionZoomActualSize(self) QAction | None

Returns the native zoom resolution (100%) action. Call trigger() on it to zoom to actual size.

Return type:

Optional[QAction]

actionZoomFullExtent(self) QAction | None

Returns the native zoom full extent action. Call trigger() on it to zoom to the full extent.

Return type:

Optional[QAction]

actionZoomIn(self) QAction | None

Returns the native zoom in action. Call trigger() on it to set the default zoom in map tool.

Return type:

Optional[QAction]

actionZoomLast(self) QAction | None

Returns the native zoom last action. Call trigger() on it to zoom to last.

Return type:

Optional[QAction]

actionZoomNext(self) QAction | None

Returns the native zoom next action. Call trigger() on it to zoom to next.

Return type:

Optional[QAction]

actionZoomOut(self) QAction | None

Returns the native zoom out action. Call trigger() on it to set the default zoom out map tool.

Return type:

Optional[QAction]

actionZoomToLayer(self) QAction | None

Returns the native zoom to layer action. Call trigger() on it to zoom to the active layer.

Deprecated since version Use: actionZoomToLayers() instead.

Return type:

Optional[QAction]

actionZoomToLayers(self) QAction | None

Returns the native zoom to layers action. Call trigger() on it to zoom to the selected layers.

Added in version 3.18.

Return type:

Optional[QAction]

actionZoomToSelected(self) QAction | None

Returns the native zoom to selected action. Call trigger() on it to zoom to the current selection.

Return type:

Optional[QAction]

activeDecorations(self) List[QgsMapDecoration]

Returns a list of the active decorations.

Added in version 3.22.

Return type:

List[QgsMapDecoration]

activeLayer(self) QgsMapLayer | None

Returns a pointer to the active layer (layer selected in the legend)

Return type:

Optional[QgsMapLayer]

addCustomActionForLayer(self, action: QAction | None, layer: QgsMapLayer | None)

Add action to context menu for a specific layer in the layer tree. It is necessary to first call addCustomActionForLayerType() with allLayers=false in order for this method to have any effect.

Parameters:
  • action (Optional[QAction])

  • layer (Optional[QgsMapLayer])

addCustomActionForLayerType(self, action: QAction | None, menu: str | None, type: Qgis.LayerType, allLayers: bool)

Add action to context menu for layers in the layer tree. If allLayers is True, then the action will be available for all layers of given type, otherwise the action will be available only for specific layers added with addCustomActionForLayer() after this call.

If menu argument is not empty, the action will be also added to a menu within the main window, creating menu with the given name if it does not exist yet.

Parameters:
  • action (Optional[QAction])

  • menu (Optional[str])

  • type (Qgis.LayerType)

  • allLayers (bool)

addDatabaseToolBarIcon(self, qAction: QAction | None) int

Add an icon to the Database toolbar

Parameters:

qAction (Optional[QAction])

Return type:

int

addDatabaseToolBarWidget(self, widget: QWidget | None) QAction | None

Add a widget to the database toolbar. To remove this widget again, call removeDatabaseToolBarIcon() with the returned QAction.

Parameters:

widget (Optional[QWidget]) – widget to add. The toolbar will take ownership of this widget

Return type:

Optional[QAction]

Returns:

the QAction you can use to remove this widget from the toolbar

addDockWidget(self, area: Qt.DockWidgetArea, dockwidget: QDockWidget | None)

Adds a dock widget to the main window, in the specified dock area.

Parameters:
  • area (Qt.DockWidgetArea)

  • dockwidget (Optional[QDockWidget])

addLayerMenu(self) QMenu | None

Returns a reference to the main window “Add Layer” menu.

Return type:

Optional[QMenu]

addMeshLayer(self, url: str | None, baseName: str | None, providerKey: str | None) QgsMeshLayer | None

Adds a mesh layer to the current project, using the specified data provider and source url.

The baseName parameter will be used as the layer name (and shown in the map legend).

Parameters:
  • url (Optional[str])

  • baseName (Optional[str])

  • providerKey (Optional[str])

Return type:

Optional[QgsMeshLayer]

addPluginToDatabaseMenu(self, name: str | None, action: QAction | None)

Add action to the Database menu

Parameters:
  • name (Optional[str])

  • action (Optional[QAction])

addPluginToMenu(self, name: str | None, action: QAction | None)

Add action to the plugins menu

Parameters:
  • name (Optional[str])

  • action (Optional[QAction])

addPluginToMeshMenu(self, name: str | None, action: QAction | None)

Add action to the Mesh menu

Added in version 3.24.

Parameters:
  • name (Optional[str])

  • action (Optional[QAction])

addPluginToRasterMenu(self, name: str | None, action: QAction | None)

Add action to the Raster menu

Parameters:
  • name (Optional[str])

  • action (Optional[QAction])

addPluginToVectorMenu(self, name: str | None, action: QAction | None)

Add action to the Vector menu

Parameters:
  • name (Optional[str])

  • action (Optional[QAction])

addPluginToWebMenu(self, name: str | None, action: QAction | None)

Add action to the Web menu

Parameters:
  • name (Optional[str])

  • action (Optional[QAction])

addPointCloudLayer(self, url: str | None, baseName: str | None, providerKey: str | None) QgsPointCloudLayer | None

Adds a point cloud layer to the current project, using the specified data provider and source url.

The baseName parameter will be used as the layer name (and shown in the map legend).

Added in version 3.18.

Parameters:
  • url (Optional[str])

  • baseName (Optional[str])

  • providerKey (Optional[str])

Return type:

Optional[QgsPointCloudLayer]

addProject(self, project: str | None) bool

Adds (opens) a project

Parameters:

project (Optional[str])

Return type:

bool

addProjectExportAction(self, action: QAction | None)

Adds an action to the QGIS “Export project” menu.

Added in version 3.30.

Parameters:

action (Optional[QAction])

addProjectImportAction(self, action: QAction | None)

Adds an action to the QGIS “Import project” menu.

Added in version 3.30.

Parameters:

action (Optional[QAction])

addRasterLayer(self, rasterLayerPath: str | None, baseName: str | None = '') QgsRasterLayer | None

Adds a raster layer to the current project, given a raster layer file name.

The baseName parameter will be used as the layer name (and shown in the map legend).

addRasterLayer(self, url: Optional[str], layerName: Optional[str], providerKey: Optional[str]) -> Optional[QgsRasterLayer] Adds a raster layer to the current project, from the specified raster data provider and source url.

The layerName parameter will be used as the layer name (and shown in the map legend).

Parameters:
  • rasterLayerPath (Optional[str])

  • baseName (Optional[str] = '')

Return type:

Optional[QgsRasterLayer]

addRasterToolBarIcon(self, qAction: QAction | None) int

Add an icon to the Raster toolbar

Parameters:

qAction (Optional[QAction])

Return type:

int

addRasterToolBarWidget(self, widget: QWidget | None) QAction | None

Add a widget to the raster toolbar. To remove this widget again, call removeRasterToolBarIcon() with the returned QAction.

Parameters:

widget (Optional[QWidget]) – widget to add. The toolbar will take ownership of this widget

Return type:

Optional[QAction]

Returns:

the QAction you can use to remove this widget from the toolbar

addTabifiedDockWidget(self, area: Qt.DockWidgetArea, dockwidget: QDockWidget | None, tabifyWith: Iterable[str | None] = [], raiseTab: bool = False)

Add a dock widget to the given area and tabify it (if other dock widgets exist in the same area). The new tab will be below other tabs unless raiseTab is passed as True.

tabifyWith is a list of dock widget object names, ordered by priority, with which the new dock widget should be tabified. Only the first matching object name will be picked. If none of the given object names is found in that area (or if tabifyWith is not given at all), the new dock widget will be created anyways, but its location within that area will be unpredictable.

Added in version 3.14.

Parameters:
  • area (Qt.DockWidgetArea)

  • dockwidget (Optional[QDockWidget])

  • tabifyWith (Iterable[Optional[str]] = [])

  • raiseTab (bool = False)

addTiledSceneLayer(self, url: str | None, baseName: str | None, providerKey: str | None) QgsTiledSceneLayer | None

Adds a tiled scene layer to the current project, using the specified data provider and source url.

The baseName parameter will be used as the layer name (and shown in the map legend).

Added in version 3.34.

Parameters:
  • url (Optional[str])

  • baseName (Optional[str])

  • providerKey (Optional[str])

Return type:

Optional[QgsTiledSceneLayer]

addToolBar(self, name: str | None) QToolBar | None

Add toolbar with specified name

addToolBar(self, toolbar: Optional[QToolBar], area: Qt.ToolBarArea = Qt.TopToolBarArea) Add a toolbar

Parameters:

name (Optional[str])

Return type:

Optional[QToolBar]

addToolBarIcon(self, qAction: QAction | None) int

Add an icon to the plugins toolbar

Parameters:

qAction (Optional[QAction])

Return type:

int

addToolBarWidget(self, widget: QWidget | None) QAction | None

Add a widget to the plugins toolbar. To remove this widget again, call removeToolBarIcon() with the returned QAction.

Parameters:

widget (Optional[QWidget]) – widget to add. The toolbar will take ownership of this widget

Return type:

Optional[QAction]

Returns:

the QAction you can use to remove this widget from the toolbar

addUserInputWidget(self, widget: QWidget | None)

Adds a widget to the user input tool bar.

Parameters:

widget (Optional[QWidget])

addVectorLayer(self, vectorLayerPath: str | None, baseName: str | None, providerKey: str | None) QgsVectorLayer | None

Adds a vector layer to the current project, using the specified data provider and source url.

The baseName parameter will be used as the layer name (and shown in the map legend).

Parameters:
  • vectorLayerPath (Optional[str])

  • baseName (Optional[str])

  • providerKey (Optional[str])

Return type:

Optional[QgsVectorLayer]

addVectorTileLayer(self, url: str | None, baseName: str | None) QgsVectorTileLayer | None

Adds a vector tile layer to the current project, using the specified source url.

The baseName parameter will be used as the layer name (and shown in the map legend).

Added in version 3.14.

Parameters:
  • url (Optional[str])

  • baseName (Optional[str])

Return type:

Optional[QgsVectorTileLayer]

addVectorToolBarIcon(self, qAction: QAction | None) int

Add an icon to the Vector toolbar

Parameters:

qAction (Optional[QAction])

Return type:

int

addVectorToolBarWidget(self, widget: QWidget | None) QAction | None

Add a widget to the vector toolbar. To remove this widget again, call removeVectorToolBarIcon() with the returned QAction.

Parameters:

widget (Optional[QWidget]) – widget to add. The toolbar will take ownership of this widget

Return type:

Optional[QAction]

Returns:

the QAction you can use to remove this widget from the toolbar

addWebToolBarIcon(self, qAction: QAction | None) int

Add an icon to the Web toolbar

Parameters:

qAction (Optional[QAction])

Return type:

int

addWebToolBarWidget(self, widget: QWidget | None) QAction | None

Add a widget to the web toolbar. To remove this widget again, call removeWebToolBarIcon() with the returned QAction.

Parameters:

widget (Optional[QWidget]) – widget to add. The toolbar will take ownership of this widget

Return type:

Optional[QAction]

Returns:

the QAction you can use to remove this widget from the toolbar

addWindow(self, action: QAction | None)

Add window to Window menu. The action title is the window title and the action should raise, unminimize and activate the window.

Parameters:

action (Optional[QAction])

advancedDigitizeToolBar(self) QToolBar | None

Returns a reference to the main window “Advanced Digitizing” toolbar.

Return type:

Optional[QToolBar]

askForDatumTransform(self, sourceCrs: QgsCoordinateReferenceSystem, destinationCrs: QgsCoordinateReferenceSystem) bool

Checks available datum transforms and ask user if several are available and none is chosen. Dialog is shown only if global option is set accordingly.

Return type:

bool

Returns:

True if a datum transform has been specifically chosen by user or only one is available.

Parameters:
attributesToolBar(self) QToolBar | None

Returns a reference to the main window “Attributes” toolbar.

Return type:

Optional[QToolBar]

blockActiveLayerChanges(self, blocked: bool)

Sets whether changes to the active layer should be temporarily blocked.

This is a low-level method, designed to avoid unnecessary work when adding lots of layers at once. Clients which will be adding many layers may call blockActiveLayerChanges( True ) upfront, add all the layers, and then follow up with a call to blockActiveLayerChanges( False ). This will defer emitting the active layer changed signal until they’ve added all layers, and only emit the signal once for the final layer added.

Warning

This must be accompanied by a subsequent call with blocked as False.

Added in version 3.36.

Parameters:

blocked (bool)

browserModel(self) QgsBrowserGuiModel | None

Returns the application browser model. Using this shared model is more efficient than creating a new browser model for every use.

Added in version 3.4.

Return type:

Optional[QgsBrowserGuiModel]

buildStyleSheet(self, opts: Dict[str | None, Any])

Generate stylesheet

Parameters:

opts (Dict[Optional[str]) – generated default option values, or a changed copy of them

cadDockWidget(self) QgsAdvancedDigitizingDockWidget | None

Advanced digitizing dock widget

Return type:

Optional[QgsAdvancedDigitizingDockWidget]

childEvent(self, a0: QChildEvent | None)
closeMapCanvas(self, name: str | None)

Closes the additional map canvas with matching name.

Parameters:

name (Optional[str])

closeMapCanvas3D(self, name: str | None)

Closes the additional map canvas with matching name.

Added in version 3.36.

Parameters:

name (Optional[str])

connectNotify(self, signal: QMetaMethod)
copySelectionToClipboard(self, a0: QgsMapLayer | None)

Copy selected features from the layer to clipboard

Parameters:

a0 (Optional[QgsMapLayer])

createNewMapCanvas(self, name: str | None) QgsMapCanvas | None

Create a new map canvas with the specified unique name.

See also

closeMapCanvas()

Parameters:

name (Optional[str])

Return type:

Optional[QgsMapCanvas]

createNewMapCanvas3D(self, name: str | None) Qgs3DMapCanvas | None

Create a new 3D map canvas with the specified unique name.

Added in version 3.36.

Parameters:

name (Optional[str])

Return type:

Optional[Qgs3DMapCanvas]

currentLayerChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...)

  • revision (int = ...)

  • arguments (Sequence = ...)

Return type:

PYQT_SIGNAL

currentThemeChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...)

  • revision (int = ...)

  • arguments (Sequence = ...)

Return type:

PYQT_SIGNAL

customEvent(self, a0: QEvent | None)
dataSourceManagerToolBar(self) QToolBar | None

Returns a reference to the main window “Data Source Manager” toolbar.

Added in version 3.4.

Return type:

Optional[QToolBar]

databaseMenu(self) QMenu | None

Returns a reference to the main window “Database” menu.

Return type:

Optional[QMenu]

databaseToolBar(self) QToolBar | None

Returns a reference to the main window “Database” toolbar.

Return type:

Optional[QToolBar]

defaultStyleSheetFont(self) QFont

Returns a reference font for initial qApp (may not be same as QgisApp)

Return type:

QFont

defaultStyleSheetOptions(self) Dict[str, Any]

Returns changeable options built from settings and/or defaults

Return type:

Dict[str, Any]

deregisterLocatorFilter(self, filter: QgsLocatorFilter | None)

Deregisters a locator filter from the app’s locator bar and deletes it. Calling this will block whilst any currently running query is terminated.

Plugins which register filters to the locator bar must take care to correctly call deregisterLocatorFilter() to deregister their filters upon plugin unload to avoid crashes.

Parameters:

filter (Optional[QgsLocatorFilter])

digitizeToolBar(self) QToolBar | None

Returns a reference to the main window “Digitize” toolbar.

Return type:

Optional[QToolBar]

disconnectNotify(self, signal: QMetaMethod)
editMenu(self) QMenu | None

Returns a reference to the main window “Edit” menu.

Return type:

Optional[QMenu]

editableLayers(self, modified: bool = False) List[QgsMapLayer]

Returns vector layers in edit mode

Parameters:

modified (bool = False) – whether to return only layers that have been modified

Return type:

List[QgsMapLayer]

Returns:

list of layers in legend order, or empty list

fileToolBar(self) QToolBar | None

Returns a reference to the main window “File” toolbar.

Return type:

Optional[QToolBar]

firstRightStandardMenu(self) QMenu | None

Returns a reference to the right most standard menu, which is usually the last menu item before the “Help” menu.

This can be used to insert additional top-level menus into their correct position BEFORE the help menu.

Return type:

Optional[QMenu]

getFeatureForm(self, l: QgsVectorLayer | None, f: QgsFeature) QgsAttributeDialog | None

Returns a feature form for a given feature.

Parameters:
  • l (Optional[QgsVectorLayer]) – The layer for which the dialog will be created

  • f (QgsFeature) – The feature for which the dialog will be created

Return type:

Optional[QgsAttributeDialog]

Returns:

A feature form

helpMenu(self) QMenu | None

Returns a reference to the main window “Help” menu.

Return type:

Optional[QMenu]

helpToolBar(self) QToolBar | None

Returns a reference to the main window “Help” toolbar.

Return type:

Optional[QToolBar]

iconSize(self, dockedToolbar: bool = False) QSize

Returns the toolbar icon size. If dockedToolbar is True, the icon size for toolbars contained within docks is returned.

Parameters:

dockedToolbar (bool = False)

Return type:

QSize

initializationCompleted

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...)

  • revision (int = ...)

  • arguments (Sequence = ...)

Return type:

PYQT_SIGNAL

insertAddLayerAction(self, action: QAction | None)

Add “add layer” action to layer menu

Parameters:

action (Optional[QAction])

invalidateLocatorResults(self)

Invalidate results from the locator filter.

This might be useful if the configuration of the filter changed without going through main application settings.

Added in version 3.2.

isSignalConnected(self, signal: QMetaMethod) bool
layerMenu(self) QMenu | None

Returns a reference to the main window “Layer” menu.

Return type:

Optional[QMenu]

layerSavedAs

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...)

  • revision (int = ...)

  • arguments (Sequence = ...)

Return type:

PYQT_SIGNAL

layerToolBar(self) QToolBar | None

Returns a reference to the main window “Layer” toolbar.

Return type:

Optional[QToolBar]

layerTreeCanvasBridge(self) QgsLayerTreeMapCanvasBridge | None

Returns a pointer to the layer tree canvas bridge

Return type:

Optional[QgsLayerTreeMapCanvasBridge]

layerTreeInsertionPoint(self) QgsLayerTreeRegistryBridge.InsertionPoint

Returns the insertion point. This represents the current layer tree group and index where newly added map layers should be inserted into.

Added in version 3.10.

Return type:

QgsLayerTreeRegistryBridge.InsertionPoint

layerTreeView(self) QgsLayerTreeView | None
Return type:

Optional[QgsLayerTreeView]

layoutDesignerClosed

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...)

  • revision (int = ...)

  • arguments (Sequence = ...)

Return type:

PYQT_SIGNAL

layoutDesignerOpened

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...)

  • revision (int = ...)

  • arguments (Sequence = ...)

Return type:

PYQT_SIGNAL

layoutDesignerWillBeClosed

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...)

  • revision (int = ...)

  • arguments (Sequence = ...)

Return type:

PYQT_SIGNAL

locatorSearch(self, searchText: str | None)

This will perform a search in the locator bar by setting the line edit text to searchText and automatically displaying any results.

Added in version 3.10.

Parameters:

searchText (Optional[str])

mainWindow(self) QWidget | None

Returns a pointer to the main window (instance of QgisApp in case of QGIS)

Return type:

Optional[QWidget]

mapCanvas(self) QgsMapCanvas | None

Returns a pointer to the map canvas

Return type:

Optional[QgsMapCanvas]

mapCanvases(self) List[QgsMapCanvas]

Returns a list of all map canvases open in the app.

Return type:

List[QgsMapCanvas]

mapCanvases3D(self) List[Qgs3DMapCanvas]

Returns a list of all 3D map canvases open in the app.

Added in version 3.36.

Return type:

List[Qgs3DMapCanvas]

mapNavToolToolBar(self) QToolBar | None

Returns a reference to the main window “Map Navigation” toolbar.

Return type:

Optional[QToolBar]

mapToolActionGroup(self) QActionGroup | None

Returns the action group for map tools.

Any actions added by plugins for toggling a map tool should also be added to this action group so that they behave identically to the native, in-built map tool actions.

Added in version 3.16.

Return type:

Optional[QActionGroup]

meshMenu(self) QMenu | None

Returns a reference to the main window “Mesh” menu.

Added in version 3.34.

Return type:

Optional[QMenu]

messageBar(self) QgsMessageBar | None

Returns the message bar of the main app

Return type:

Optional[QgsMessageBar]

messageTimeout(self) int

Returns the timeout for timed messages: default of 5 seconds

Return type:

int

newLayerMenu(self) QMenu | None

Returns a reference to the main window “Create New Layer” menu.

Return type:

Optional[QMenu]

newProject(self, promptToSaveFlag: bool = False) bool

Starts a new blank project.

If promptToSaveFlag is True then users will be prompted to save any currently open project (if that project has changes). If the flag is False, then the current project will be closed without prompting to save (possibly resulting in data loss).

Since QGIS 3.10.1, returns True if a new project was created, or False if the operation was not successful (e.g. the user opted to cancel when prompted to save the current project).

Parameters:

promptToSaveFlag (bool = False)

Return type:

bool

newProjectCreated

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...)

  • revision (int = ...)

  • arguments (Sequence = ...)

Return type:

PYQT_SIGNAL

openDataSourceManagerPage(self, pageName: str | None)

Opens a page in the main window “Data Source Manager” dialog.

This method creates and opens the dialog if it is not already visible.

Added in version 3.30.

Parameters:

pageName (Optional[str])

openFeatureForm(self, l: QgsVectorLayer | None, f: QgsFeature, updateFeatureOnly: bool = False, showModal: bool = True) bool

Opens a new feature form. Returns True if dialog was accepted (if shown modal, True otherwise).

Parameters:
  • l (Optional[QgsVectorLayer]) – vector layer

  • f (QgsFeature) – feature to show/modify

  • updateFeatureOnly (bool = False) – only update the feature update (don’t change any attributes of the layer) [UNUSED]

  • showModal (bool = True) – if True, will wait for the dialog to be executed (only shown otherwise)

Return type:

bool

openLayoutDesigner(self, layout: QgsMasterLayoutInterface | None) QgsLayoutDesignerInterface | None

Opens a new layout designer dialog for the specified layout, or brings an already open designer window to the foreground if one is already created for the layout.

Parameters:

layout (Optional[QgsMasterLayoutInterface])

Return type:

Optional[QgsLayoutDesignerInterface]

openLayoutDesigners(self) List[QgsLayoutDesignerInterface]

Returns all currently open layout designers.

Return type:

List[QgsLayoutDesignerInterface]

openMessageLog(self)

Opens the message log dock widget.

openURL(self, url: str | None, useQgisDocDirectory: bool = True)

Open a url in the users browser. By default the QGIS doc directory is used as the base for the URL. To open a URL that is not relative to the installed QGIS documentation, set useQgisDocDirectory to False.

Parameters:
  • url (Optional[str]) – URL to open

  • useQgisDocDirectory (bool = True) – If True, the URL will be formed by concatenating url to the QGIS documentation directory path (prefix/share/doc)

Deprecated since version Use: QDesktopServices instead

pasteFromClipboard(self, a0: QgsMapLayer | None)

Paste features from clipboard to the layer

Parameters:

a0 (Optional[QgsMapLayer])

pluginHelpMenu(self) QMenu | None

Returns a reference to the main window “Plugin Help” sub-menu.

Plugins are encouraged to insert help and about actions in this submenu instead of creating a submenu under the pluginMenu() which solely contains Plugin Help or About actions.

Added in version 3.10.

Return type:

Optional[QMenu]

pluginManagerInterface(self) QgsPluginManagerInterface | None
Return type:

Optional[QgsPluginManagerInterface]

pluginMenu(self) QMenu | None

Returns a reference to the main window “Plugin” menu.

Return type:

Optional[QMenu]

pluginToolBar(self) QToolBar | None

Returns a reference to the main window “Plugin” toolbar.

Return type:

Optional[QToolBar]

preloadForm(self, uifile: str | None)

This method is only needed when using a UI form with a custom widget plugin and calling openFeatureForm or getFeatureForm from Python (PyQt) and you haven’t used the info tool first. Python will crash bringing QGIS with it if the custom form is not loaded from a C++ method call.

This method uses a QTimer to call QUiLoader in order to load the form via C++. You only need to call this once. After that you can call openFeatureForm/getFeatureForm like usual.

More information here: http://qt-project.org/forums/viewthread/27098

Parameters:

uifile (Optional[str])

projectImportExportMenu(self) QMenu | None

Returns a reference to the main window “Import/Export” project menu.

Added in version 3.30.

Return type:

Optional[QMenu]

projectMenu(self) QMenu | None

Returns a reference to the main window “Project” menu.

Return type:

Optional[QMenu]

projectRead

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...)

  • revision (int = ...)

  • arguments (Sequence = ...)

Return type:

PYQT_SIGNAL

rasterMenu(self) QMenu | None

Returns a reference to the main window “Raster” menu.

Return type:

Optional[QMenu]

rasterToolBar(self) QToolBar | None

Returns a reference to the main window “Raster” toolbar.

Return type:

Optional[QToolBar]

receivers(self, signal: PYQT_SIGNAL) int
registerApplicationExitBlocker(self, blocker: QgsApplicationExitBlockerInterface | None)

Register a new application exit blocker, which can be used to prevent the QGIS application from exiting while a plugin or script has unsaved changes.

Note

Ownership of blocker is not transferred, and the blocker must be unregistered when plugin is unloaded.

Added in version 3.16.

Parameters:

blocker (Optional[QgsApplicationExitBlockerInterface])

registerCustomDropHandler(self, handler: QgsCustomDropHandler | None)

Register a new custom drop handler.

Note

Ownership of handler is not transferred, and the handler must be unregistered when plugin is unloaded.

Parameters:

handler (Optional[QgsCustomDropHandler])

registerCustomLayoutDropHandler(self, handler: QgsLayoutCustomDropHandler | None)

Register a new custom drop handler for layout windows.

Note

Ownership of handler is not transferred, and the handler must be unregistered when plugin is unloaded.

Parameters:

handler (Optional[QgsLayoutCustomDropHandler])

registerCustomProjectOpenHandler(self, handler: QgsCustomProjectOpenHandler | None)

Register a new custom project open handler.

Note

Ownership of handler is not transferred, and the handler must be unregistered when plugin is unloaded.

Added in version 3.14.

Parameters:

handler (Optional[QgsCustomProjectOpenHandler])

registerDevToolWidgetFactory(self, factory: QgsDevToolWidgetFactory | None)

Register a new tool in the development/debugging tools dock.

Note

Ownership of the factory is not transferred, and the factory must be unregistered when plugin is unloaded.

Added in version 3.14.

Parameters:

factory (Optional[QgsDevToolWidgetFactory])

registerLocatorFilter(self, filter: QgsLocatorFilter | None)

Registers a locator filter for the app’s locator bar. Ownership of the filter is transferred to the locator.

Warning

Plugins which register filters to the locator bar must take care to correctly call deregisterLocatorFilter() and deregister their filters upon plugin unload to avoid crashes.

Parameters:

filter (Optional[QgsLocatorFilter])

registerMainWindowAction(self, action: QAction | None, defaultShortcut: str | None) bool

Register action to the shortcuts manager so its shortcut can be changed in GUI

Parameters:
  • action (Optional[QAction])

  • defaultShortcut (Optional[str])

Return type:

bool

registerMapLayerConfigWidgetFactory(self, factory: QgsMapLayerConfigWidgetFactory | None)

Register a new tab in the map layer properties dialog.

Note

Ownership of the factory is not transferred, and the factory must be unregistered when plugin is unloaded.

Parameters:

factory (Optional[QgsMapLayerConfigWidgetFactory])

registerMapToolHandler(self, handler: QgsAbstractMapToolHandler | None)

Register a new application map tool handler, which can be used to automatically setup all connections and logic required to switch to a custom map tool whenever the state of the QGIS application permits.

Note

Ownership of handler is not transferred, and the handler must be unregistered when plugin is unloaded.

Added in version 3.16.

Parameters:

handler (Optional[QgsAbstractMapToolHandler])

registerOptionsWidgetFactory(self, factory: QgsOptionsWidgetFactory | None)

Register a new tab in the options dialog.

Note

Ownership of the factory is not transferred, and the factory must be unregistered when plugin is unloaded.

Parameters:

factory (Optional[QgsOptionsWidgetFactory])

registerProjectPropertiesWidgetFactory(self, factory: QgsOptionsWidgetFactory | None)

Register a new tab in the project properties dialog.

Note

Ownership of the factory is not transferred, and the factory must be unregistered when plugin is unloaded.

Added in version 3.16.

Parameters:

factory (Optional[QgsOptionsWidgetFactory])

reloadConnections(self)

Triggered when connections have changed. This calls reloadConnections in the main application and triggers a signal that is forwarded to the GUI elements that needs to be updated (i.e. the source select dialogs and the browser widgets)

removeAddLayerAction(self, action: QAction | None)

Remove “add layer” action from layer menu

Parameters:

action (Optional[QAction])

removeCustomActionForLayerType(self, action: QAction | None) bool

Remove action for layers in the layer tree previously added with addCustomActionForLayerType()

Parameters:

action (Optional[QAction])

Return type:

bool

removeDatabaseToolBarIcon(self, qAction: QAction | None)

Remove an action (icon) from the Database toolbar

Parameters:

qAction (Optional[QAction])

removeDockWidget(self, dockwidget: QDockWidget | None)

Removes the specified dock widget from main window (without deleting it).

See also

addDockWidget()

Parameters:

dockwidget (Optional[QDockWidget])

removePluginDatabaseMenu(self, name: str | None, action: QAction | None)

Remove action from the Database menu

Parameters:
  • name (Optional[str])

  • action (Optional[QAction])

removePluginMenu(self, name: str | None, action: QAction | None)

Remove action from the plugins menu

Parameters:
  • name (Optional[str])

  • action (Optional[QAction])

removePluginMeshMenu(self, name: str | None, action: QAction | None)

Remove action from the Mesh menu

Added in version 3.24.

Parameters:
  • name (Optional[str])

  • action (Optional[QAction])

removePluginRasterMenu(self, name: str | None, action: QAction | None)

Remove action from the Raster menu

Parameters:
  • name (Optional[str])

  • action (Optional[QAction])

removePluginVectorMenu(self, name: str | None, action: QAction | None)

Remove action from the Vector menu

Parameters:
  • name (Optional[str])

  • action (Optional[QAction])

removePluginWebMenu(self, name: str | None, action: QAction | None)

Remove action from the Web menu

Parameters:
  • name (Optional[str])

  • action (Optional[QAction])

removeProjectExportAction(self, action: QAction | None)

Adds an action to the QGIS “Export project” menu.

Added in version 3.30.

Parameters:

action (Optional[QAction])

removeProjectImportAction(self, action: QAction | None)

Adds an action to the QGIS “Import project” menu.

Added in version 3.30.

Parameters:

action (Optional[QAction])

removeRasterToolBarIcon(self, qAction: QAction | None)

Remove an action (icon) from the Raster toolbar

Parameters:

qAction (Optional[QAction])

removeToolBarIcon(self, qAction: QAction | None)

Remove an action (icon) from the plugin toolbar

Parameters:

qAction (Optional[QAction])

removeVectorToolBarIcon(self, qAction: QAction | None)

Remove an action (icon) from the Vector toolbar

Parameters:

qAction (Optional[QAction])

removeWebToolBarIcon(self, qAction: QAction | None)

Remove an action (icon) from the Web toolbar

Parameters:

qAction (Optional[QAction])

removeWindow(self, action: QAction | None)

Remove window from Window menu. Calling this is necessary only for windows which are hidden rather than deleted when closed.

Parameters:

action (Optional[QAction])

saveStyleSheetOptions(self, opts: Dict[str | None, Any])

Save changed default option keys/values to user settings

Parameters:

opts (Dict[Optional[str])

selectionToolBar(self) QToolBar | None

Returns a reference to the main window “Selection” toolbar.

Added in version 3.14.

Return type:

Optional[QToolBar]

sender(self) QObject | None
senderSignalIndex(self) int
setActiveLayer(self, a0: QgsMapLayer | None) bool

Set the active layer (layer gets selected in the legend) returns True if the layer exists, False otherwise

Parameters:

a0 (Optional[QgsMapLayer])

Return type:

bool

setGpsPanelConnection(self, connection: QgsGpsConnection | None)

Sets a GPS connection to use within the GPS Panel widget.

Any existing GPS connection used by the widget will be disconnect and replaced with this connection. The connection is automatically registered within the QgsApplication.gpsConnectionRegistry().

Added in version 3.16.

Parameters:

connection (Optional[QgsGpsConnection])

settingsMenu(self) QMenu | None

Returns a reference to the main window “Settings” menu.

Return type:

Optional[QMenu]

shapeDigitizeToolBar(self) QToolBar | None

Returns a reference to the main window “Shape Digitizing” toolbar.

Return type:

Optional[QToolBar]

showAttributeTable(self, l: QgsVectorLayer | None, filterExpression: str | None = '') QDialog | None

Open attribute table dialog

Parameters:
Return type:

Optional[QDialog]

showLayerProperties(self, l: QgsMapLayer | None, page: str | None = '')

Opens layer properties dialog for the layer l. Optionally, a page to open can be specified (since QGIS 3.20). The list below contains valid page names:

Vector Layer: mOptsPage_Information, mOptsPage_Source, mOptsPage_Style, mOptsPage_Labels, mOptsPage_Masks, mOptsPage_Diagrams, mOptsPage_SourceFields, mOptsPage_AttributesForm, mOptsPage_Joins, mOptsPage_AuxiliaryStorage, mOptsPage_Actions, mOptsPage_Display, mOptsPage_Rendering, mOptsPage_Temporal, mOptsPage_Variables, mOptsPage_Elevation, mOptsPage_Metadata, mOptsPage_DataDependencies, mOptsPage_Legend, mOptsPage_Server

Raster Layer: mOptsPage_Information, mOptsPage_Source, mOptsPage_Style, mOptsPage_Transparency, mOptsPage_Histogram, mOptsPage_Rendering, mOptsPage_Temporal, mOptsPage_Pyramids, mOptsPage_Elevation, mOptsPage_Metadata, mOptsPage_Legend, mOptsPage_Server

Mesh Layer: mOptsPage_Information, mOptsPage_Source, mOptsPage_Style, mOptsPage_StyleContent, mOptsPage_Rendering, mOptsPage_Temporal, mOptsPage_Elevation, mOptsPage_Metadata

Point Cloud Layer: mOptsPage_Information, mOptsPage_Source, mOptsPage_Elevation, mOptsPage_Metadata, mOptsPage_Statistics, mOptsPage_Rendering

Vector Tile Layer: mOptsPage_Information, mOptsPage_Style, mOptsPage_Labeling, mOptsPage_Metadata

Note

Page names are subject to change without notice between QGIS versions, they are not considered part of the stable API.

Note

More strings may be available depending on the context, e.g. via plugins.

Parameters:
showLayoutManager(self)

Opens the layout manager dialog.

showOptionsDialog(self, parent: QWidget | None = None, currentPage: str | None = '')

Opens the options dialog. The currentPage argument can be used to force the dialog to open at a specific page.

Parameters:
  • parent (Optional[QWidget] = None)

  • currentPage (Optional[str] = '')

showProjectPropertiesDialog(self, currentPage: str | None = '')

Opens the project properties dialog. The currentPage argument can be used to force the dialog to open at a specific page.

Added in version 3.16.

Parameters:

currentPage (Optional[str] = '')

statusBarIface(self) QgsStatusBar | None

Returns a pointer to the app’s status bar interface. This should be used for interacting and adding widgets and messages to the app’s status bar (do not use the native Qt statusBar() method).

Return type:

Optional[QgsStatusBar]

takeAppScreenShots(self, saveDirectory: str | None, categories: int = 0)

Take screenshots for user documentation

Parameters:
  • saveDirectory (Optional[str]) – path where the screenshots will be saved

  • categories (int = 0) – an int as a flag value of QgsAppScreenShots.Categories

Added in version 3.4.

timerEvent(self, a0: QTimerEvent | None)
unregisterApplicationExitBlocker(self, blocker: QgsApplicationExitBlockerInterface | None)

Unregister a previously registered application exit blocker.

Added in version 3.16.

Parameters:

blocker (Optional[QgsApplicationExitBlockerInterface])

unregisterCustomDropHandler(self, handler: QgsCustomDropHandler | None)

Unregister a previously registered custom drop handler.

Parameters:

handler (Optional[QgsCustomDropHandler])

unregisterCustomLayoutDropHandler(self, handler: QgsLayoutCustomDropHandler | None)

Unregister a previously registered custom drop handler for layout windows.

Parameters:

handler (Optional[QgsLayoutCustomDropHandler])

unregisterCustomProjectOpenHandler(self, handler: QgsCustomProjectOpenHandler | None)

Unregister a previously registered custom project open handler.

Added in version 3.14.

Parameters:

handler (Optional[QgsCustomProjectOpenHandler])

unregisterDevToolWidgetFactory(self, factory: QgsDevToolWidgetFactory | None)

Unregister a previously registered tool factory from the development/debugging tools dock.

Added in version 3.14.

Parameters:

factory (Optional[QgsDevToolWidgetFactory])

unregisterMainWindowAction(self, action: QAction | None) bool

Unregister a previously registered action. (e.g. when plugin is going to be unloaded)

Parameters:

action (Optional[QAction])

Return type:

bool

unregisterMapLayerConfigWidgetFactory(self, factory: QgsMapLayerConfigWidgetFactory | None)

Unregister a previously registered tab in the map layer properties dialog.

Parameters:

factory (Optional[QgsMapLayerConfigWidgetFactory])

unregisterMapToolHandler(self, handler: QgsAbstractMapToolHandler | None)

Unregister a previously registered map tool handler.

Added in version 3.16.

Parameters:

handler (Optional[QgsAbstractMapToolHandler])

unregisterOptionsWidgetFactory(self, factory: QgsOptionsWidgetFactory | None)

Unregister a previously registered tab in the options dialog.

Parameters:

factory (Optional[QgsOptionsWidgetFactory])

unregisterProjectPropertiesWidgetFactory(self, factory: QgsOptionsWidgetFactory | None)

Unregister a previously registered tab in the options dialog.

Added in version 3.16.

Parameters:

factory (Optional[QgsOptionsWidgetFactory])

userProfileManager(self) QgsUserProfileManager | None

Returns a reference to the user profile manager

Added in version 3.30.

Return type:

Optional[QgsUserProfileManager]

vectorLayerTools(self) QgsVectorLayerTools | None

Access the vector layer tools instance. With the help of this you can access methods like addFeature, startEditing or stopEditing while giving the user the appropriate dialogs.

Return type:

Optional[QgsVectorLayerTools]

Returns:

An instance of the vector layer tools

vectorMenu(self) QMenu | None

Returns a reference to the main window “Vector” menu.

Return type:

Optional[QMenu]

vectorToolBar(self) QToolBar | None

Returns a reference to the main window “Vector” toolbar.

Return type:

Optional[QToolBar]

viewMenu(self) QMenu | None

Returns a reference to the main window “View” menu.

Return type:

Optional[QMenu]

webMenu(self) QMenu | None

Returns a reference to the main window “Web” menu.

Return type:

Optional[QMenu]

webToolBar(self) QToolBar | None

Returns a reference to the main window “Web” toolbar.

Return type:

Optional[QToolBar]

windowMenu(self) QMenu | None

Returns a reference to the main window “Window” menu.

Return type:

Optional[QMenu]

zoomFull(self)

Zooms to the full extent of all map layers.

zoomToActiveLayer(self)

Zooms to extent of the active layer.

zoomToNext(self)

Zooms to the next view extent.

zoomToPrevious(self)

Zooms to the previous view extent.