QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | List of all members
QgisInterface Class Referenceabstract

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

#include <qgisinterface.h>

Inheritance diagram for QgisInterface:
Inheritance graph
[legend]

Public Slots

virtual int addDatabaseToolBarIcon (QAction *qAction)=0
 Add an icon to the Database toolbar.
 
virtual QAction * addDatabaseToolBarWidget (QWidget *widget)=0
 Add a widget to the database toolbar.
 
virtual void addDockWidget (Qt::DockWidgetArea area, QDockWidget *dockwidget)=0
 Adds a dock widget to the main window, in the specified dock area.
 
virtual QgsMeshLayeraddMeshLayer (const QString &url, const QString &baseName, const QString &providerKey)=0
 Adds a mesh layer to the current project, using the specified data provider and source url.
 
virtual void addPluginToDatabaseMenu (const QString &name, QAction *action)=0
 Add action to the Database menu.
 
virtual void addPluginToMenu (const QString &name, QAction *action)=0
 Add action to the plugins menu.
 
virtual void addPluginToMeshMenu (const QString &name, QAction *action)=0
 Add action to the Mesh menu.
 
virtual void addPluginToRasterMenu (const QString &name, QAction *action)=0
 Add action to the Raster menu.
 
virtual void addPluginToVectorMenu (const QString &name, QAction *action)=0
 Add action to the Vector menu.
 
virtual void addPluginToWebMenu (const QString &name, QAction *action)=0
 Add action to the Web menu.
 
virtual QgsPointCloudLayeraddPointCloudLayer (const QString &url, const QString &baseName, const QString &providerKey)=0
 Adds a point cloud layer to the current project, using the specified data provider and source url.
 
virtual bool addProject (const QString &project)=0
 Adds (opens) a project.
 
virtual QgsRasterLayeraddRasterLayer (const QString &rasterLayerPath, const QString &baseName=QString())=0
 Adds a raster layer to the current project, given a raster layer file name.
 
virtual QgsRasterLayeraddRasterLayer (const QString &url, const QString &layerName, const QString &providerKey)=0
 Adds a raster layer to the current project, from the specified raster data provider and source url.
 
virtual int addRasterToolBarIcon (QAction *qAction)=0
 Add an icon to the Raster toolbar.
 
virtual QAction * addRasterToolBarWidget (QWidget *widget)=0
 Add a widget to the raster toolbar.
 
virtual void addTabifiedDockWidget (Qt::DockWidgetArea area, QDockWidget *dockwidget, const QStringList &tabifyWith=QStringList(), bool raiseTab=false)=0
 Add a dock widget to the given area and tabify it (if other dock widgets exist in the same area).
 
virtual QgsTiledSceneLayeraddTiledSceneLayer (const QString &url, const QString &baseName, const QString &providerKey)=0
 Adds a tiled scene layer to the current project, using the specified data provider and source url.
 
virtual QToolBar * addToolBar (const QString &name)=0
 Add toolbar with specified name.
 
virtual void addToolBar (QToolBar *toolbar, Qt::ToolBarArea area=Qt::TopToolBarArea)=0
 Add a toolbar.
 
virtual int addToolBarIcon (QAction *qAction)=0
 Add an icon to the plugins toolbar.
 
virtual QAction * addToolBarWidget (QWidget *widget)=0
 Add a widget to the plugins toolbar.
 
virtual void addUserInputWidget (QWidget *widget)=0
 Adds a widget to the user input tool bar.
 
virtual QgsVectorLayeraddVectorLayer (const QString &vectorLayerPath, const QString &baseName, const QString &providerKey)=0
 Adds a vector layer to the current project, using the specified data provider and source url.
 
virtual QgsVectorTileLayeraddVectorTileLayer (const QString &url, const QString &baseName)=0
 Adds a vector tile layer to the current project, using the specified source url.
 
virtual int addVectorToolBarIcon (QAction *qAction)=0
 Add an icon to the Vector toolbar.
 
virtual QAction * addVectorToolBarWidget (QWidget *widget)=0
 Add a widget to the vector toolbar.
 
virtual int addWebToolBarIcon (QAction *qAction)=0
 Add an icon to the Web toolbar.
 
virtual QAction * addWebToolBarWidget (QWidget *widget)=0
 Add a widget to the web toolbar.
 
virtual void addWindow (QAction *action)=0
 Add window to Window menu.
 
virtual bool askForDatumTransform (QgsCoordinateReferenceSystem sourceCrs, QgsCoordinateReferenceSystem destinationCrs)=0
 Checks available datum transforms and ask user if several are available and none is chosen.
 
virtual QgsBrowserGuiModelbrowserModel ()=0
 Returns the application browser model.
 
virtual void buildStyleSheet (const QMap< QString, QVariant > &opts)=0
 Generate stylesheet.
 
virtual void copySelectionToClipboard (QgsMapLayer *)=0
 Copy selected features from the layer to clipboard.
 
virtual void deregisterLocatorFilter (QgsLocatorFilter *filter)=0
 Deregisters a locator filter from the app's locator bar and deletes it.
 
virtual QgsAttributeDialoggetFeatureForm (QgsVectorLayer *l, QgsFeature &f)=0
 Returns a feature form for a given feature.
 
virtual void insertAddLayerAction (QAction *action)=0
 Add "add layer" action to layer menu.
 
virtual void invalidateLocatorResults ()=0
 Invalidate results from the locator filter.
 
virtual void locatorSearch (const QString &searchText)=0
 This will perform a search in the locator bar by setting the line edit text to searchText and automatically displaying any results.
 
virtual bool newProject (bool promptToSaveFlag=false)=0
 Starts a new blank project.
 
virtual bool openFeatureForm (QgsVectorLayer *l, QgsFeature &f, bool updateFeatureOnly=false, bool showModal=true)=0
 Opens a new feature form.
 
virtual QgsLayoutDesignerInterfaceopenLayoutDesigner (QgsMasterLayoutInterface *layout)=0
 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.
 
virtual void openMessageLog ()=0
 Opens the message log dock widget.
 
virtual Q_DECL_DEPRECATED void openURL (const QString &url, bool useQgisDocDirectory=true)=0
 Open a url in the users browser.
 
virtual void pasteFromClipboard (QgsMapLayer *)=0
 Paste features from clipboard to the layer.
 
virtual void preloadForm (const QString &uifile)=0
 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.
 
virtual void registerApplicationExitBlocker (QgsApplicationExitBlockerInterface *blocker)=0
 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.
 
virtual void registerCustomDropHandler (QgsCustomDropHandler *handler)=0
 Register a new custom drop handler.
 
virtual void registerCustomLayoutDropHandler (QgsLayoutCustomDropHandler *handler)=0
 Register a new custom drop handler for layout windows.
 
virtual void registerCustomProjectOpenHandler (QgsCustomProjectOpenHandler *handler)=0
 Register a new custom project open handler.
 
virtual void registerDevToolWidgetFactory (QgsDevToolWidgetFactory *factory)=0
 Register a new tool in the development/debugging tools dock.
 
virtual void registerLocatorFilter (QgsLocatorFilter *filter)=0
 Registers a locator filter for the app's locator bar.
 
virtual bool registerMainWindowAction (QAction *action, const QString &defaultShortcut)=0
 Register action to the shortcuts manager so its shortcut can be changed in GUI.
 
virtual void registerMapLayerConfigWidgetFactory (QgsMapLayerConfigWidgetFactory *factory)=0
 Register a new tab in the map layer properties dialog.
 
virtual void registerMapToolHandler (QgsAbstractMapToolHandler *handler)=0
 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.
 
virtual void registerOptionsWidgetFactory (QgsOptionsWidgetFactory *factory)=0
 Register a new tab in the options dialog.
 
virtual void registerProjectPropertiesWidgetFactory (QgsOptionsWidgetFactory *factory)=0
 Register a new tab in the project properties dialog.
 
virtual void reloadConnections ()=0
 Triggered when connections have changed.
 
virtual void removeAddLayerAction (QAction *action)=0
 Remove "add layer" action from layer menu.
 
virtual void removeDatabaseToolBarIcon (QAction *qAction)=0
 Remove an action (icon) from the Database toolbar.
 
virtual void removeDockWidget (QDockWidget *dockwidget)=0
 Removes the specified dock widget from main window (without deleting it).
 
virtual void removePluginDatabaseMenu (const QString &name, QAction *action)=0
 Remove action from the Database menu.
 
virtual void removePluginMenu (const QString &name, QAction *action)=0
 Remove action from the plugins menu.
 
virtual void removePluginMeshMenu (const QString &name, QAction *action)=0
 Remove action from the Mesh menu.
 
virtual void removePluginRasterMenu (const QString &name, QAction *action)=0
 Remove action from the Raster menu.
 
virtual void removePluginVectorMenu (const QString &name, QAction *action)=0
 Remove action from the Vector menu.
 
virtual void removePluginWebMenu (const QString &name, QAction *action)=0
 Remove action from the Web menu.
 
virtual void removeRasterToolBarIcon (QAction *qAction)=0
 Remove an action (icon) from the Raster toolbar.
 
virtual void removeToolBarIcon (QAction *qAction)=0
 Remove an action (icon) from the plugin toolbar.
 
virtual void removeVectorToolBarIcon (QAction *qAction)=0
 Remove an action (icon) from the Vector toolbar.
 
virtual void removeWebToolBarIcon (QAction *qAction)=0
 Remove an action (icon) from the Web toolbar.
 
virtual void removeWindow (QAction *action)=0
 Remove window from Window menu.
 
virtual void saveStyleSheetOptions (const QMap< QString, QVariant > &opts)=0
 Save changed default option keys/values to user settings.
 
virtual bool setActiveLayer (QgsMapLayer *)=0
 Set the active layer (layer gets selected in the legend) returns true if the layer exists, false otherwise.
 
virtual void setGpsPanelConnection (QgsGpsConnection *connection)=0
 Sets a GPS connection to use within the GPS Panel widget.
 
virtual QDialog * showAttributeTable (QgsVectorLayer *l, const QString &filterExpression=QString())=0
 Open attribute table dialog.
 
virtual void showLayerProperties (QgsMapLayer *l, const QString &page=QString())=0
 Opens layer properties dialog for the layer l.
 
virtual void showLayoutManager ()=0
 Opens the layout manager dialog.
 
virtual void showOptionsDialog (QWidget *parent=nullptr, const QString &currentPage=QString())=0
 Opens the options dialog.
 
virtual void showProjectPropertiesDialog (const QString &currentPage=QString())=0
 Opens the project properties dialog.
 
virtual void unregisterApplicationExitBlocker (QgsApplicationExitBlockerInterface *blocker)=0
 Unregister a previously registered application exit blocker.
 
virtual void unregisterCustomDropHandler (QgsCustomDropHandler *handler)=0
 Unregister a previously registered custom drop handler.
 
virtual void unregisterCustomLayoutDropHandler (QgsLayoutCustomDropHandler *handler)=0
 Unregister a previously registered custom drop handler for layout windows.
 
virtual void unregisterCustomProjectOpenHandler (QgsCustomProjectOpenHandler *handler)=0
 Unregister a previously registered custom project open handler.
 
virtual void unregisterDevToolWidgetFactory (QgsDevToolWidgetFactory *factory)=0
 Unregister a previously registered tool factory from the development/debugging tools dock.
 
virtual bool unregisterMainWindowAction (QAction *action)=0
 Unregister a previously registered action. (e.g. when plugin is going to be unloaded)
 
virtual void unregisterMapLayerConfigWidgetFactory (QgsMapLayerConfigWidgetFactory *factory)=0
 Unregister a previously registered tab in the map layer properties dialog.
 
virtual void unregisterMapToolHandler (QgsAbstractMapToolHandler *handler)=0
 Unregister a previously registered map tool handler.
 
virtual void unregisterOptionsWidgetFactory (QgsOptionsWidgetFactory *factory)=0
 Unregister a previously registered tab in the options dialog.
 
virtual void unregisterProjectPropertiesWidgetFactory (QgsOptionsWidgetFactory *factory)=0
 Unregister a previously registered tab in the options dialog.
 
virtual void zoomFull ()=0
 Zooms to the full extent of all map layers.
 
virtual void zoomToActiveLayer ()=0
 Zooms to extent of the active layer.
 
virtual void zoomToNext ()=0
 Zooms to the next view extent.
 
virtual void zoomToPrevious ()=0
 Zooms to the previous view extent.
 

Signals

void currentLayerChanged (QgsMapLayer *layer)
 Emitted whenever current (selected) layer changes.
 
void currentThemeChanged (const QString &theme)
 Emitted when the current theme is changed so plugins can change their tool button icons.
 
void initializationCompleted ()
 Emitted when the initialization is complete.
 
void layerSavedAs (QgsMapLayer *l, const QString &path)
 Emitted when a layer has been saved using save as.
 
void layoutDesignerClosed ()
 Emitted after a layout designer window is closed.
 
void layoutDesignerOpened (QgsLayoutDesignerInterface *designer)
 Emitted when a new layout designer has been opened.
 
void layoutDesignerWillBeClosed (QgsLayoutDesignerInterface *designer)
 Emitted before a layout designer is going to be closed and deleted.
 
void newProjectCreated ()
 Emitted when starting an entirely new project.
 
void projectRead ()
 Emitted when a project file is successfully read.
 

Public Member Functions

 QgisInterface ()=default
 Constructor.
 
virtual QAction * actionAbout ()=0
 
virtual QAction * actionAddAfsLayer ()=0
 Returns the native Add ArcGIS REST Server action.
 
virtual QAction * actionAddAllToOverview ()=0
 
virtual QAction * actionAddAmsLayer ()=0
 Returns the native Add ArcGIS REST Server action.
 
virtual QAction * actionAddFeature ()=0
 Returns the native Add Feature action.
 
virtual QAction * actionAddOgrLayer ()=0
 
virtual QAction * actionAddPart ()=0
 Returns the native Add Part action.
 
virtual QAction * actionAddPgLayer ()=0
 
virtual QAction * actionAddPointCloudLayer ()=0
 Returns the native Add Point Cloud Layer action.
 
virtual QAction * actionAddRasterLayer ()=0
 
virtual QAction * actionAddRing ()=0
 Returns the native Add Ring action.
 
virtual QAction * actionAddToOverview ()=0
 
virtual QAction * actionAddVectorTileLayer ()=0
 Returns the native Add Vector Tile Layer action.
 
virtual QAction * actionAddWmsLayer ()=0
 
virtual QAction * actionAddXyzLayer ()=0
 Returns the native Add XYZ Layer action.
 
virtual QAction * actionAllEdits ()=0
 
virtual QAction * actionCancelAllEdits ()=0
 
virtual QAction * actionCancelEdits ()=0
 
virtual QAction * actionCheckQgisVersion ()=0
 
virtual Q_DECL_DEPRECATED QAction * actionCircle2Points ()
 Returns the native add circle from 2 points action.
 
virtual Q_DECL_DEPRECATED QAction * actionCircle2TangentsPoint ()
 Returns the native add circle from 2 tangents and a point action.
 
virtual Q_DECL_DEPRECATED QAction * actionCircle3Points ()
 Returns the native add circle from 3 points action.
 
virtual Q_DECL_DEPRECATED QAction * actionCircle3Tangents ()
 Returns the native add circle from 3 tangents action.
 
virtual Q_DECL_DEPRECATED QAction * actionCircleCenterPoint ()
 Returns the native add circle from center action.
 
virtual QAction * actionCopyFeatures ()=0
 Returns the native Copy Features action.
 
virtual QAction * actionCopyLayerStyle ()=0
 
virtual QAction * actionCreatePrintLayout ()=0
 Create new print layout action.
 
virtual QAction * actionCustomProjection ()=0
 
virtual QAction * actionCutFeatures ()=0
 Returns the native Cut Features action.
 
virtual QAction * actionDeletePart ()=0
 Returns the native Delete Part action.
 
virtual QAction * actionDeleteRing ()=0
 Returns the native Delete Ring action.
 
virtual QAction * actionDeleteSelected ()=0
 Returns the native Delete Selected Features action.
 
virtual QAction * actionDraw ()=0
 Returns the native draw action.
 
virtual QAction * actionDuplicateLayer ()=0
 
virtual Q_DECL_DEPRECATED QAction * actionEllipseCenter2Points ()
 Returns the native add ellipse from center and 2 points action.
 
virtual Q_DECL_DEPRECATED QAction * actionEllipseCenterPoint ()
 Returns the native add ellipse from center and a point action.
 
virtual Q_DECL_DEPRECATED QAction * actionEllipseExtent ()
 Returns the native add ellipse from an extent action.
 
virtual Q_DECL_DEPRECATED QAction * actionEllipseFoci ()
 Returns the native add ellipse from foci action.
 
virtual QAction * actionExit ()=0
 Returns the Exit QGIS action.
 
virtual QAction * actionFeatureAction ()=0
 Returns the native run action feature action. Call trigger() on it to set the default run feature action map tool.
 
virtual QAction * actionHelpContents ()=0
 
virtual QAction * actionHideAllLayers ()=0
 
virtual QAction * actionHideDeselectedLayers ()=0
 Returns the Hide Deselected Layers action.
 
virtual QAction * actionHideSelectedLayers ()=0
 
virtual QAction * actionIdentify ()=0
 Returns the native identify action. Call trigger() on it to set the default identify map tool.
 
virtual QAction * actionLayerProperties ()=0
 
virtual QAction * actionLayerSaveAs ()=0
 
virtual QAction * actionManagePlugins ()=0
 
virtual QAction * actionMapTips ()=0
 Returns the native map tips action. Call trigger() on it to toggle map tips.
 
virtual QAction * actionMeasure ()=0
 Returns the native measure action. Call trigger() on it to set the default measure map tool.
 
virtual QAction * actionMeasureArea ()=0
 Returns the native measure area action. Call trigger() on it to set the default measure area map tool.
 
virtual QAction * actionMoveFeature ()=0
 Returns the native Move Features action.
 
virtual QAction * actionNewBookmark ()=0
 Returns the native new bookmark action. Call trigger() on it to open the new bookmark dialog.
 
virtual QAction * actionNewProject ()=0
 Returns the native New Project action.
 
virtual QAction * actionNewVectorLayer ()=0
 
virtual QAction * actionOpenFieldCalculator ()=0
 
virtual QAction * actionOpenProject ()=0
 Returns the Open Project action.
 
virtual QAction * actionOpenStatisticalSummary ()=0
 Statistical summary action.
 
virtual QAction * actionOpenTable ()=0
 
virtual QAction * actionOptions ()=0
 
virtual QAction * actionPan ()=0
 Returns the native pan action. Call trigger() on it to set the default pan map tool.
 
virtual QAction * actionPanToSelected ()=0
 Returns the native pan to selected action. Call trigger() on it to pan the map canvas to the selection.
 
virtual QAction * actionPasteFeatures ()=0
 Returns the native Paste Features action.
 
virtual QAction * actionPasteLayerStyle ()=0
 
virtual QAction * actionPluginListSeparator ()=0
 
virtual QAction * actionProjectProperties ()=0
 Returns the native Project Properties action.
 
virtual QAction * actionQgisHomePage ()=0
 
virtual Q_DECL_DEPRECATED QAction * actionRectangle3PointsDistance ()
 Returns the native add rectangle from 3 points (distance from 2nd and 3rd points) action.
 
virtual Q_DECL_DEPRECATED QAction * actionRectangle3PointsProjected ()
 Returns the native add rectangle from 3 points (distance from projected 3rd point on segment p1 and p2) action.
 
virtual Q_DECL_DEPRECATED QAction * actionRectangleCenterPoint ()
 Returns the native add rectangle from center and a point action.
 
virtual Q_DECL_DEPRECATED QAction * actionRectangleExtent ()
 Returns the native add rectangle from extent action.
 
virtual Q_DECL_DEPRECATED QAction * actionRegularPolygon2Points ()
 Returns the native add regular polygon from 2 points action.
 
virtual Q_DECL_DEPRECATED QAction * actionRegularPolygonCenterCorner ()
 Returns the native add regular polygon from center and a corner action.
 
virtual Q_DECL_DEPRECATED QAction * actionRegularPolygonCenterPoint ()
 Returns the native add regular polygon from center and a point action.
 
virtual QAction * actionRemoveAllFromOverview ()=0
 
virtual QAction * actionRollbackAllEdits ()=0
 
virtual QAction * actionRollbackEdits ()=0
 
virtual QAction * actionSaveActiveLayerEdits ()=0
 
virtual QAction * actionSaveAllEdits ()=0
 
virtual QAction * actionSaveEdits ()=0
 
virtual QAction * actionSaveMapAsImage ()=0
 Returns the native Save Map as Image action.
 
virtual QAction * actionSaveProject ()=0
 Returns the native Save Project action.
 
virtual QAction * actionSaveProjectAs ()=0
 Returns the native Save Project As action.
 
virtual QAction * actionSelect ()=0
 Returns the native select action. Call trigger() on it to set the default select map tool.
 
virtual QAction * actionSelectFreehand ()=0
 Returns the native select freehand action. Call trigger() on it to set the default select freehand map tool.
 
virtual QAction * actionSelectPolygon ()=0
 Returns the native select polygon action. Call trigger() on it to set the default select polygon map tool.
 
virtual QAction * actionSelectRadius ()=0
 Returns the native select radius action. Call trigger() on it to set the default select radius map tool.
 
virtual QAction * actionSelectRectangle ()=0
 Returns the native select rectangle action. Call trigger() on it to set the default select rectangle map tool.
 
virtual QAction * actionShowAllLayers ()=0
 
virtual QAction * actionShowBookmarks ()=0
 Returns the native show bookmarks action. Call trigger() on it to open the bookmarks dialog.
 
virtual QAction * actionShowLayoutManager ()=0
 Show layout manager action.
 
virtual QAction * actionShowPythonDialog ()=0
 
virtual QAction * actionShowSelectedLayers ()=0
 
virtual QAction * actionSimplifyFeature ()=0
 Returns the native Simplify/Smooth Features action.
 
virtual QAction * actionSplitFeatures ()=0
 Returns the native Split Features action.
 
virtual QAction * actionSplitParts ()=0
 Returns the native Split Parts action.
 
virtual QAction * actionToggleEditing ()=0
 
virtual QAction * actionToggleFullScreen ()=0
 
virtual QAction * actionToggleSelectedLayers ()=0
 Returns the Toggle Selected Layers action.
 
virtual QAction * actionToggleSelectedLayersIndependently ()=0
 Returns the Toggle Selected Layers Independently action.
 
virtual QAction * actionVertexTool ()=0
 Returns the native "Vertex Tool for All Layers" action.
 
virtual QAction * actionVertexToolActiveLayer ()=0
 Returns the native "Vertex Tool for Active Layer" action.
 
virtual QAction * actionZoomActualSize ()=0
 Returns the native zoom resolution (100%) action. Call trigger() on it to zoom to actual size.
 
virtual QAction * actionZoomFullExtent ()=0
 Returns the native zoom full extent action. Call trigger() on it to zoom to the full extent.
 
virtual QAction * actionZoomIn ()=0
 Returns the native zoom in action. Call trigger() on it to set the default zoom in map tool.
 
virtual QAction * actionZoomLast ()=0
 Returns the native zoom last action. Call trigger() on it to zoom to last.
 
virtual QAction * actionZoomNext ()=0
 Returns the native zoom next action. Call trigger() on it to zoom to next.
 
virtual QAction * actionZoomOut ()=0
 Returns the native zoom out action. Call trigger() on it to set the default zoom out map tool.
 
virtual Q_DECL_DEPRECATED QAction * actionZoomToLayer ()=0
 Returns the native zoom to layer action.
 
virtual QAction * actionZoomToLayers ()=0
 Returns the native zoom to layers action.
 
virtual QAction * actionZoomToSelected ()=0
 Returns the native zoom to selected action. Call trigger() on it to zoom to the current selection.
 
virtual QList< QgsMapDecoration * > activeDecorations ()=0
 Returns a list of the active decorations.
 
virtual QgsMapLayeractiveLayer ()=0
 Returns a pointer to the active layer (layer selected in the legend)
 
virtual void addCustomActionForLayer (QAction *action, QgsMapLayer *layer)=0
 Add action to context menu for a specific layer in the layer tree.
 
virtual void addCustomActionForLayerType (QAction *action, QString menu, Qgis::LayerType type, bool allLayers)=0
 Add action to context menu for layers in the layer tree.
 
virtual QMenu * addLayerMenu ()=0
 Returns a reference to the main window "Add Layer" menu.
 
virtual void addProjectExportAction (QAction *action)=0
 Adds an action to the QGIS "Export project" menu.
 
virtual void addProjectImportAction (QAction *action)=0
 Adds an action to the QGIS "Import project" menu.
 
virtual QToolBar * advancedDigitizeToolBar ()=0
 Returns a reference to the main window "Advanced Digitizing" toolbar.
 
virtual QToolBar * attributesToolBar ()=0
 Returns a reference to the main window "Attributes" toolbar.
 
virtual QgsAdvancedDigitizingDockWidgetcadDockWidget ()=0
 Advanced digitizing dock widget.
 
virtual void closeMapCanvas (const QString &name)=0
 Closes the additional map canvas with matching name.
 
virtual QgsMapCanvascreateNewMapCanvas (const QString &name)=0
 Create a new map canvas with the specified unique name.
 
virtual QMenu * databaseMenu ()=0
 Returns a reference to the main window "Database" menu.
 
virtual QToolBar * databaseToolBar ()=0
 Returns a reference to the main window "Database" toolbar.
 
virtual QToolBar * dataSourceManagerToolBar ()=0
 Returns a reference to the main window "Data Source Manager" toolbar.
 
virtual QFont defaultStyleSheetFont ()=0
 Returns a reference font for initial qApp (may not be same as QgisApp)
 
virtual QMap< QString, QVariant > defaultStyleSheetOptions ()=0
 Returns changeable options built from settings and/or defaults.
 
virtual QToolBar * digitizeToolBar ()=0
 Returns a reference to the main window "Digitize" toolbar.
 
virtual QList< QgsMapLayer * > editableLayers (bool modified=false) const =0
 Returns vector layers in edit mode.
 
virtual QMenu * editMenu ()=0
 Returns a reference to the main window "Edit" menu.
 
virtual QToolBar * fileToolBar ()=0
 Returns a reference to the main window "File" toolbar.
 
virtual QMenu * firstRightStandardMenu ()=0
 Returns a reference to the right most standard menu, which is usually the last menu item before the "Help" menu.
 
virtual QMenu * helpMenu ()=0
 Returns a reference to the main window "Help" menu.
 
virtual QToolBar * helpToolBar ()=0
 Returns a reference to the main window "Help" toolbar.
 
virtual QSize iconSize (bool dockedToolbar=false) const =0
 Returns the toolbar icon size.
 
virtual QMenu * layerMenu ()=0
 Returns a reference to the main window "Layer" menu.
 
virtual QToolBar * layerToolBar ()=0
 Returns a reference to the main window "Layer" toolbar.
 
virtual QgsLayerTreeMapCanvasBridgelayerTreeCanvasBridge ()=0
 Returns a pointer to the layer tree canvas bridge.
 
virtual QgsLayerTreeRegistryBridge::InsertionPoint layerTreeInsertionPoint ()=0
 Returns the insertion point.
 
virtual QgsLayerTreeViewlayerTreeView ()=0
 
virtual QWidget * mainWindow ()=0
 Returns a pointer to the main window (instance of QgisApp in case of QGIS)
 
virtual QgsMapCanvasmapCanvas ()=0
 Returns a pointer to the map canvas.
 
virtual QList< QgsMapCanvas * > mapCanvases ()=0
 Returns a list of all map canvases open in the app.
 
virtual QToolBar * mapNavToolToolBar ()=0
 Returns a reference to the main window "Map Navigation" toolbar.
 
virtual QActionGroup * mapToolActionGroup ()=0
 Returns the action group for map tools.
 
virtual QgsMessageBarmessageBar ()=0
 Returns the message bar of the main app.
 
virtual int messageTimeout ()=0
 Returns the timeout for timed messages: default of 5 seconds.
 
virtual QMenu * newLayerMenu ()=0
 Returns a reference to the main window "Create New Layer" menu.
 
virtual void openDataSourceManagerPage (const QString &pageName)=0
 Opens a page in the main window "Data Source Manager" dialog.
 
virtual QList< QgsLayoutDesignerInterface * > openLayoutDesigners ()=0
 Returns all currently open layout designers.
 
virtual QMenu * pluginHelpMenu ()=0
 Returns a reference to the main window "Plugin Help" sub-menu.
 
virtual QgsPluginManagerInterfacepluginManagerInterface ()=0
 
virtual QMenu * pluginMenu ()=0
 Returns a reference to the main window "Plugin" menu.
 
virtual QToolBar * pluginToolBar ()=0
 Returns a reference to the main window "Plugin" toolbar.
 
virtual QMenu * projectImportExportMenu ()=0
 Returns a reference to the main window "Import/Export" project menu.
 
virtual QMenu * projectMenu ()=0
 Returns a reference to the main window "Project" menu.
 
virtual QMenu * rasterMenu ()=0
 Returns a reference to the main window "Raster" menu.
 
virtual QToolBar * rasterToolBar ()=0
 Returns a reference to the main window "Raster" toolbar.
 
virtual bool removeCustomActionForLayerType (QAction *action)=0
 Remove action for layers in the layer tree previously added with addCustomActionForLayerType()
 
virtual void removeProjectExportAction (QAction *action)=0
 Adds an action to the QGIS "Export project" menu.
 
virtual void removeProjectImportAction (QAction *action)=0
 Adds an action to the QGIS "Import project" menu.
 
virtual QToolBar * selectionToolBar ()=0
 Returns a reference to the main window "Selection" toolbar.
 
virtual QMenu * settingsMenu ()=0
 Returns a reference to the main window "Settings" menu.
 
virtual QToolBar * shapeDigitizeToolBar ()=0
 Returns a reference to the main window "Shape Digitizing" toolbar.
 
virtual QgsStatusBarstatusBarIface ()=0
 Returns a pointer to the app's status bar interface.
 
virtual void takeAppScreenShots (const QString &saveDirectory, const int categories=0)
 Take screenshots for user documentation.
 
virtual QgsUserProfileManageruserProfileManager ()=0
 Returns a reference to the user profile manager.
 
virtual QgsVectorLayerToolsvectorLayerTools ()=0
 Access the vector layer tools instance.
 
virtual QMenu * vectorMenu ()=0
 Returns a reference to the main window "Vector" menu.
 
virtual QToolBar * vectorToolBar ()=0
 Returns a reference to the main window "Vector" toolbar.
 
virtual QMenu * viewMenu ()=0
 Returns a reference to the main window "View" menu.
 
virtual QMenu * webMenu ()=0
 Returns a reference to the main window "Web" menu.
 
virtual QToolBar * webToolBar ()=0
 Returns a reference to the main window "Web" toolbar.
 
virtual QMenu * windowMenu ()=0
 Returns a reference to the main window "Window" menu.
 

Detailed Description

QgisInterface 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.

Definition at line 90 of file qgisinterface.h.

Constructor & Destructor Documentation

◆ QgisInterface()

QgisInterface::QgisInterface ( )
default

Constructor.

Member Function Documentation

◆ actionAbout()

virtual QAction * QgisInterface::actionAbout ( )
pure virtual

◆ actionAddAfsLayer()

virtual QAction * QgisInterface::actionAddAfsLayer ( )
pure virtual

Returns the native Add ArcGIS REST Server action.

◆ actionAddAllToOverview()

virtual QAction * QgisInterface::actionAddAllToOverview ( )
pure virtual

◆ actionAddAmsLayer()

virtual QAction * QgisInterface::actionAddAmsLayer ( )
pure virtual

Returns the native Add ArcGIS REST Server action.

◆ actionAddFeature()

virtual QAction * QgisInterface::actionAddFeature ( )
pure virtual

Returns the native Add Feature action.

◆ actionAddOgrLayer()

virtual QAction * QgisInterface::actionAddOgrLayer ( )
pure virtual

◆ actionAddPart()

virtual QAction * QgisInterface::actionAddPart ( )
pure virtual

Returns the native Add Part action.

◆ actionAddPgLayer()

virtual QAction * QgisInterface::actionAddPgLayer ( )
pure virtual

◆ actionAddPointCloudLayer()

virtual QAction * QgisInterface::actionAddPointCloudLayer ( )
pure virtual

Returns the native Add Point Cloud Layer action.

Since
QGIS 3.18

◆ actionAddRasterLayer()

virtual QAction * QgisInterface::actionAddRasterLayer ( )
pure virtual

◆ actionAddRing()

virtual QAction * QgisInterface::actionAddRing ( )
pure virtual

Returns the native Add Ring action.

◆ actionAddToOverview()

virtual QAction * QgisInterface::actionAddToOverview ( )
pure virtual

◆ actionAddVectorTileLayer()

virtual QAction * QgisInterface::actionAddVectorTileLayer ( )
pure virtual

Returns the native Add Vector Tile Layer action.

Since
QGIS 3.14

◆ actionAddWmsLayer()

virtual QAction * QgisInterface::actionAddWmsLayer ( )
pure virtual

◆ actionAddXyzLayer()

virtual QAction * QgisInterface::actionAddXyzLayer ( )
pure virtual

Returns the native Add XYZ Layer action.

Since
QGIS 3.14

◆ actionAllEdits()

virtual QAction * QgisInterface::actionAllEdits ( )
pure virtual

◆ actionCancelAllEdits()

virtual QAction * QgisInterface::actionCancelAllEdits ( )
pure virtual

◆ actionCancelEdits()

virtual QAction * QgisInterface::actionCancelEdits ( )
pure virtual

◆ actionCheckQgisVersion()

virtual QAction * QgisInterface::actionCheckQgisVersion ( )
pure virtual

◆ actionCircle2Points()

virtual Q_DECL_DEPRECATED QAction * QgisInterface::actionCircle2Points ( )
inlinevirtual

Returns the native add circle from 2 points action.

Call trigger() on it to set the map tool.

Deprecated:
since 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().

Definition at line 674 of file qgisinterface.h.

◆ actionCircle2TangentsPoint()

virtual Q_DECL_DEPRECATED QAction * QgisInterface::actionCircle2TangentsPoint ( )
inlinevirtual

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

Call trigger() on it to set the map tool.

Deprecated:
since 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().

Definition at line 692 of file qgisinterface.h.

◆ actionCircle3Points()

virtual Q_DECL_DEPRECATED QAction * QgisInterface::actionCircle3Points ( )
inlinevirtual

Returns the native add circle from 3 points action.

Call trigger() on it to set the map tool.

Deprecated:
since 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().

Definition at line 680 of file qgisinterface.h.

◆ actionCircle3Tangents()

virtual Q_DECL_DEPRECATED QAction * QgisInterface::actionCircle3Tangents ( )
inlinevirtual

Returns the native add circle from 3 tangents action.

Call trigger() on it to set the map tool.

Deprecated:
since 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().

Definition at line 686 of file qgisinterface.h.

◆ actionCircleCenterPoint()

virtual Q_DECL_DEPRECATED QAction * QgisInterface::actionCircleCenterPoint ( )
inlinevirtual

Returns the native add circle from center action.

Call trigger() on it to set the map tool.

Deprecated:
since 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().

Definition at line 698 of file qgisinterface.h.

◆ actionCopyFeatures()

virtual QAction * QgisInterface::actionCopyFeatures ( )
pure virtual

Returns the native Copy Features action.

◆ actionCopyLayerStyle()

virtual QAction * QgisInterface::actionCopyLayerStyle ( )
pure virtual

◆ actionCreatePrintLayout()

virtual QAction * QgisInterface::actionCreatePrintLayout ( )
pure virtual

Create new print layout action.

◆ actionCustomProjection()

virtual QAction * QgisInterface::actionCustomProjection ( )
pure virtual

◆ actionCutFeatures()

virtual QAction * QgisInterface::actionCutFeatures ( )
pure virtual

Returns the native Cut Features action.

◆ actionDeletePart()

virtual QAction * QgisInterface::actionDeletePart ( )
pure virtual

Returns the native Delete Part action.

◆ actionDeleteRing()

virtual QAction * QgisInterface::actionDeleteRing ( )
pure virtual

Returns the native Delete Ring action.

◆ actionDeleteSelected()

virtual QAction * QgisInterface::actionDeleteSelected ( )
pure virtual

Returns the native Delete Selected Features action.

◆ actionDraw()

virtual QAction * QgisInterface::actionDraw ( )
pure virtual

Returns the native draw action.

◆ actionDuplicateLayer()

virtual QAction * QgisInterface::actionDuplicateLayer ( )
pure virtual

◆ actionEllipseCenter2Points()

virtual Q_DECL_DEPRECATED QAction * QgisInterface::actionEllipseCenter2Points ( )
inlinevirtual

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

Call trigger() on it to set the map tool.

Deprecated:
since 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().

Definition at line 704 of file qgisinterface.h.

◆ actionEllipseCenterPoint()

virtual Q_DECL_DEPRECATED QAction * QgisInterface::actionEllipseCenterPoint ( )
inlinevirtual

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

Call trigger() on it to set the map tool.

Deprecated:
since 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().

Definition at line 710 of file qgisinterface.h.

◆ actionEllipseExtent()

virtual Q_DECL_DEPRECATED QAction * QgisInterface::actionEllipseExtent ( )
inlinevirtual

Returns the native add ellipse from an extent action.

Call trigger() on it to set the map tool.

Deprecated:
since 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().

Definition at line 716 of file qgisinterface.h.

◆ actionEllipseFoci()

virtual Q_DECL_DEPRECATED QAction * QgisInterface::actionEllipseFoci ( )
inlinevirtual

Returns the native add ellipse from foci action.

Call trigger() on it to set the map tool.

Deprecated:
since 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().

Definition at line 722 of file qgisinterface.h.

◆ actionExit()

virtual QAction * QgisInterface::actionExit ( )
pure virtual

Returns the Exit QGIS action.

◆ actionFeatureAction()

virtual QAction * QgisInterface::actionFeatureAction ( )
pure virtual

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

◆ actionHelpContents()

virtual QAction * QgisInterface::actionHelpContents ( )
pure virtual

◆ actionHideAllLayers()

virtual QAction * QgisInterface::actionHideAllLayers ( )
pure virtual

◆ actionHideDeselectedLayers()

virtual QAction * QgisInterface::actionHideDeselectedLayers ( )
pure virtual

Returns the Hide Deselected Layers action.

Since
QGIS 3.0

◆ actionHideSelectedLayers()

virtual QAction * QgisInterface::actionHideSelectedLayers ( )
pure virtual

◆ actionIdentify()

virtual QAction * QgisInterface::actionIdentify ( )
pure virtual

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

◆ actionLayerProperties()

virtual QAction * QgisInterface::actionLayerProperties ( )
pure virtual

◆ actionLayerSaveAs()

virtual QAction * QgisInterface::actionLayerSaveAs ( )
pure virtual

◆ actionManagePlugins()

virtual QAction * QgisInterface::actionManagePlugins ( )
pure virtual

◆ actionMapTips()

virtual QAction * QgisInterface::actionMapTips ( )
pure virtual

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

◆ actionMeasure()

virtual QAction * QgisInterface::actionMeasure ( )
pure virtual

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

◆ actionMeasureArea()

virtual QAction * QgisInterface::actionMeasureArea ( )
pure virtual

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

◆ actionMoveFeature()

virtual QAction * QgisInterface::actionMoveFeature ( )
pure virtual

Returns the native Move Features action.

◆ actionNewBookmark()

virtual QAction * QgisInterface::actionNewBookmark ( )
pure virtual

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

◆ actionNewProject()

virtual QAction * QgisInterface::actionNewProject ( )
pure virtual

Returns the native New Project action.

◆ actionNewVectorLayer()

virtual QAction * QgisInterface::actionNewVectorLayer ( )
pure virtual

◆ actionOpenFieldCalculator()

virtual QAction * QgisInterface::actionOpenFieldCalculator ( )
pure virtual

◆ actionOpenProject()

virtual QAction * QgisInterface::actionOpenProject ( )
pure virtual

Returns the Open Project action.

◆ actionOpenStatisticalSummary()

virtual QAction * QgisInterface::actionOpenStatisticalSummary ( )
pure virtual

Statistical summary action.

Since
QGIS 3.0

◆ actionOpenTable()

virtual QAction * QgisInterface::actionOpenTable ( )
pure virtual

◆ actionOptions()

virtual QAction * QgisInterface::actionOptions ( )
pure virtual

◆ actionPan()

virtual QAction * QgisInterface::actionPan ( )
pure virtual

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

◆ actionPanToSelected()

virtual QAction * QgisInterface::actionPanToSelected ( )
pure virtual

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

◆ actionPasteFeatures()

virtual QAction * QgisInterface::actionPasteFeatures ( )
pure virtual

Returns the native Paste Features action.

◆ actionPasteLayerStyle()

virtual QAction * QgisInterface::actionPasteLayerStyle ( )
pure virtual

◆ actionPluginListSeparator()

virtual QAction * QgisInterface::actionPluginListSeparator ( )
pure virtual

◆ actionProjectProperties()

virtual QAction * QgisInterface::actionProjectProperties ( )
pure virtual

Returns the native Project Properties action.

◆ actionQgisHomePage()

virtual QAction * QgisInterface::actionQgisHomePage ( )
pure virtual

◆ actionRectangle3PointsDistance()

virtual Q_DECL_DEPRECATED QAction * QgisInterface::actionRectangle3PointsDistance ( )
inlinevirtual

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 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().

Definition at line 740 of file qgisinterface.h.

◆ actionRectangle3PointsProjected()

virtual Q_DECL_DEPRECATED QAction * QgisInterface::actionRectangle3PointsProjected ( )
inlinevirtual

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 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().

Definition at line 746 of file qgisinterface.h.

◆ actionRectangleCenterPoint()

virtual Q_DECL_DEPRECATED QAction * QgisInterface::actionRectangleCenterPoint ( )
inlinevirtual

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

Call trigger() on it to set the map tool.

Deprecated:
since 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().

Definition at line 728 of file qgisinterface.h.

◆ actionRectangleExtent()

virtual Q_DECL_DEPRECATED QAction * QgisInterface::actionRectangleExtent ( )
inlinevirtual

Returns the native add rectangle from extent action.

Call trigger() on it to set the map tool.

Deprecated:
since 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().

Definition at line 734 of file qgisinterface.h.

◆ actionRegularPolygon2Points()

virtual Q_DECL_DEPRECATED QAction * QgisInterface::actionRegularPolygon2Points ( )
inlinevirtual

Returns the native add regular polygon from 2 points action.

Call trigger() on it to set the map tool.

Deprecated:
since 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().

Definition at line 752 of file qgisinterface.h.

◆ actionRegularPolygonCenterCorner()

virtual Q_DECL_DEPRECATED QAction * QgisInterface::actionRegularPolygonCenterCorner ( )
inlinevirtual

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

Call trigger() on it to set the map tool.

Deprecated:
since 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().

Definition at line 764 of file qgisinterface.h.

◆ actionRegularPolygonCenterPoint()

virtual Q_DECL_DEPRECATED QAction * QgisInterface::actionRegularPolygonCenterPoint ( )
inlinevirtual

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

Call trigger() on it to set the map tool.

Deprecated:
since 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().

Definition at line 758 of file qgisinterface.h.

◆ actionRemoveAllFromOverview()

virtual QAction * QgisInterface::actionRemoveAllFromOverview ( )
pure virtual

◆ actionRollbackAllEdits()

virtual QAction * QgisInterface::actionRollbackAllEdits ( )
pure virtual

◆ actionRollbackEdits()

virtual QAction * QgisInterface::actionRollbackEdits ( )
pure virtual

◆ actionSaveActiveLayerEdits()

virtual QAction * QgisInterface::actionSaveActiveLayerEdits ( )
pure virtual

◆ actionSaveAllEdits()

virtual QAction * QgisInterface::actionSaveAllEdits ( )
pure virtual

◆ actionSaveEdits()

virtual QAction * QgisInterface::actionSaveEdits ( )
pure virtual

◆ actionSaveMapAsImage()

virtual QAction * QgisInterface::actionSaveMapAsImage ( )
pure virtual

Returns the native Save Map as Image action.

◆ actionSaveProject()

virtual QAction * QgisInterface::actionSaveProject ( )
pure virtual

Returns the native Save Project action.

◆ actionSaveProjectAs()

virtual QAction * QgisInterface::actionSaveProjectAs ( )
pure virtual

Returns the native Save Project As action.

◆ actionSelect()

virtual QAction * QgisInterface::actionSelect ( )
pure virtual

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

◆ actionSelectFreehand()

virtual QAction * QgisInterface::actionSelectFreehand ( )
pure virtual

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

◆ actionSelectPolygon()

virtual QAction * QgisInterface::actionSelectPolygon ( )
pure virtual

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

◆ actionSelectRadius()

virtual QAction * QgisInterface::actionSelectRadius ( )
pure virtual

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

◆ actionSelectRectangle()

virtual QAction * QgisInterface::actionSelectRectangle ( )
pure virtual

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

◆ actionShowAllLayers()

virtual QAction * QgisInterface::actionShowAllLayers ( )
pure virtual

◆ actionShowBookmarks()

virtual QAction * QgisInterface::actionShowBookmarks ( )
pure virtual

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

◆ actionShowLayoutManager()

virtual QAction * QgisInterface::actionShowLayoutManager ( )
pure virtual

Show layout manager action.

◆ actionShowPythonDialog()

virtual QAction * QgisInterface::actionShowPythonDialog ( )
pure virtual

◆ actionShowSelectedLayers()

virtual QAction * QgisInterface::actionShowSelectedLayers ( )
pure virtual

◆ actionSimplifyFeature()

virtual QAction * QgisInterface::actionSimplifyFeature ( )
pure virtual

Returns the native Simplify/Smooth Features action.

◆ actionSplitFeatures()

virtual QAction * QgisInterface::actionSplitFeatures ( )
pure virtual

Returns the native Split Features action.

◆ actionSplitParts()

virtual QAction * QgisInterface::actionSplitParts ( )
pure virtual

Returns the native Split Parts action.

◆ actionToggleEditing()

virtual QAction * QgisInterface::actionToggleEditing ( )
pure virtual

◆ actionToggleFullScreen()

virtual QAction * QgisInterface::actionToggleFullScreen ( )
pure virtual

◆ actionToggleSelectedLayers()

virtual QAction * QgisInterface::actionToggleSelectedLayers ( )
pure virtual

Returns the Toggle Selected Layers action.

Since
QGIS 3.14

◆ actionToggleSelectedLayersIndependently()

virtual QAction * QgisInterface::actionToggleSelectedLayersIndependently ( )
pure virtual

Returns the Toggle Selected Layers Independently action.

Since
QGIS 3.14

◆ actionVertexTool()

virtual QAction * QgisInterface::actionVertexTool ( )
pure virtual

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

See also
actionVertexToolActiveLayer()

◆ actionVertexToolActiveLayer()

virtual QAction * QgisInterface::actionVertexToolActiveLayer ( )
pure virtual

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

See also
actionVertexTool()
Since
QGIS 3.6

◆ actionZoomActualSize()

virtual QAction * QgisInterface::actionZoomActualSize ( )
pure virtual

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

◆ actionZoomFullExtent()

virtual QAction * QgisInterface::actionZoomFullExtent ( )
pure virtual

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

◆ actionZoomIn()

virtual QAction * QgisInterface::actionZoomIn ( )
pure virtual

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

◆ actionZoomLast()

virtual QAction * QgisInterface::actionZoomLast ( )
pure virtual

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

◆ actionZoomNext()

virtual QAction * QgisInterface::actionZoomNext ( )
pure virtual

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

◆ actionZoomOut()

virtual QAction * QgisInterface::actionZoomOut ( )
pure virtual

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

◆ actionZoomToLayer()

virtual Q_DECL_DEPRECATED QAction * QgisInterface::actionZoomToLayer ( )
pure virtual

Returns the native zoom to layer action.

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

Deprecated:
Use actionZoomToLayers() instead.

◆ actionZoomToLayers()

virtual QAction * QgisInterface::actionZoomToLayers ( )
pure virtual

Returns the native zoom to layers action.

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

Since
QGIS 3.18

◆ actionZoomToSelected()

virtual QAction * QgisInterface::actionZoomToSelected ( )
pure virtual

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

◆ activeDecorations()

virtual QList< QgsMapDecoration * > QgisInterface::activeDecorations ( )
pure virtual

Returns a list of the active decorations.

Since
QGIS 3.22

◆ activeLayer()

virtual QgsMapLayer * QgisInterface::activeLayer ( )
pure virtual

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

◆ addCustomActionForLayer()

virtual void QgisInterface::addCustomActionForLayer ( QAction *  action,
QgsMapLayer layer 
)
pure virtual

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.

See also
addCustomActionForLayerType()

◆ addCustomActionForLayerType()

virtual void QgisInterface::addCustomActionForLayerType ( QAction *  action,
QString  menu,
Qgis::LayerType  type,
bool  allLayers 
)
pure virtual

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.

See also
removeCustomActionForLayerType()
addCustomActionForLayer()

◆ addDatabaseToolBarIcon

virtual int QgisInterface::addDatabaseToolBarIcon ( QAction *  qAction)
pure virtualslot

Add an icon to the Database toolbar.

◆ addDatabaseToolBarWidget

virtual QAction * QgisInterface::addDatabaseToolBarWidget ( QWidget *  widget)
pure virtualslot

Add a widget to the database toolbar.

To remove this widget again, call removeDatabaseToolBarIcon() with the returned QAction.

Parameters
widgetwidget to add. The toolbar will take ownership of this widget
Returns
the QAction you can use to remove this widget from the toolbar

◆ addDockWidget

virtual void QgisInterface::addDockWidget ( Qt::DockWidgetArea  area,
QDockWidget *  dockwidget 
)
pure virtualslot

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

See also
addTabifiedDockWidget()
removeDockWidget()

◆ addLayerMenu()

virtual QMenu * QgisInterface::addLayerMenu ( )
pure virtual

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

Since
QGIS 2.5

◆ addMeshLayer

virtual QgsMeshLayer * QgisInterface::addMeshLayer ( const QString &  url,
const QString &  baseName,
const QString &  providerKey 
)
pure virtualslot

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).

◆ addPluginToDatabaseMenu

virtual void QgisInterface::addPluginToDatabaseMenu ( const QString &  name,
QAction *  action 
)
pure virtualslot

Add action to the Database menu.

◆ addPluginToMenu

virtual void QgisInterface::addPluginToMenu ( const QString &  name,
QAction *  action 
)
pure virtualslot

Add action to the plugins menu.

◆ addPluginToMeshMenu

virtual void QgisInterface::addPluginToMeshMenu ( const QString &  name,
QAction *  action 
)
pure virtualslot

Add action to the Mesh menu.

Since
QGIS 3.24

◆ addPluginToRasterMenu

virtual void QgisInterface::addPluginToRasterMenu ( const QString &  name,
QAction *  action 
)
pure virtualslot

Add action to the Raster menu.

◆ addPluginToVectorMenu

virtual void QgisInterface::addPluginToVectorMenu ( const QString &  name,
QAction *  action 
)
pure virtualslot

Add action to the Vector menu.

◆ addPluginToWebMenu

virtual void QgisInterface::addPluginToWebMenu ( const QString &  name,
QAction *  action 
)
pure virtualslot

Add action to the Web menu.

◆ addPointCloudLayer

virtual QgsPointCloudLayer * QgisInterface::addPointCloudLayer ( const QString &  url,
const QString &  baseName,
const QString &  providerKey 
)
pure virtualslot

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).

Since
QGIS 3.18

◆ addProject

virtual bool QgisInterface::addProject ( const QString &  project)
pure virtualslot

Adds (opens) a project.

◆ addProjectExportAction()

virtual void QgisInterface::addProjectExportAction ( QAction *  action)
pure virtual

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

See also
removeProjectExportAction()
addProjectImportAction()
Since
QGIS 3.30

◆ addProjectImportAction()

virtual void QgisInterface::addProjectImportAction ( QAction *  action)
pure virtual

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

See also
removeProjectImportAction()
addProjectExportAction()
Since
QGIS 3.30

◆ addRasterLayer [1/2]

virtual QgsRasterLayer * QgisInterface::addRasterLayer ( const QString &  rasterLayerPath,
const QString &  baseName = QString() 
)
pure virtualslot

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 [2/2]

virtual QgsRasterLayer * QgisInterface::addRasterLayer ( const QString &  url,
const QString &  layerName,
const QString &  providerKey 
)
pure virtualslot

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).

◆ addRasterToolBarIcon

virtual int QgisInterface::addRasterToolBarIcon ( QAction *  qAction)
pure virtualslot

Add an icon to the Raster toolbar.

◆ addRasterToolBarWidget

virtual QAction * QgisInterface::addRasterToolBarWidget ( QWidget *  widget)
pure virtualslot

Add a widget to the raster toolbar.

To remove this widget again, call removeRasterToolBarIcon() with the returned QAction.

Parameters
widgetwidget to add. The toolbar will take ownership of this widget
Returns
the QAction you can use to remove this widget from the toolbar

◆ addTabifiedDockWidget

virtual void QgisInterface::addTabifiedDockWidget ( Qt::DockWidgetArea  area,
QDockWidget *  dockwidget,
const QStringList &  tabifyWith = QStringList(),
bool  raiseTab = false 
)
pure virtualslot

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.

Since
QGIS 3.14

◆ addTiledSceneLayer

virtual QgsTiledSceneLayer * QgisInterface::addTiledSceneLayer ( const QString &  url,
const QString &  baseName,
const QString &  providerKey 
)
pure virtualslot

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).

Since
QGIS 3.34

◆ addToolBar [1/2]

virtual QToolBar * QgisInterface::addToolBar ( const QString &  name)
pure virtualslot

Add toolbar with specified name.

◆ addToolBar [2/2]

virtual void QgisInterface::addToolBar ( QToolBar *  toolbar,
Qt::ToolBarArea  area = Qt::TopToolBarArea 
)
pure virtualslot

Add a toolbar.

Since
QGIS 2.3

◆ addToolBarIcon

virtual int QgisInterface::addToolBarIcon ( QAction *  qAction)
pure virtualslot

Add an icon to the plugins toolbar.

◆ addToolBarWidget

virtual QAction * QgisInterface::addToolBarWidget ( QWidget *  widget)
pure virtualslot

Add a widget to the plugins toolbar.

To remove this widget again, call removeToolBarIcon() with the returned QAction.

Parameters
widgetwidget to add. The toolbar will take ownership of this widget
Returns
the QAction you can use to remove this widget from the toolbar

◆ addUserInputWidget

virtual void QgisInterface::addUserInputWidget ( QWidget *  widget)
pure virtualslot

Adds a widget to the user input tool bar.

◆ addVectorLayer

virtual QgsVectorLayer * QgisInterface::addVectorLayer ( const QString &  vectorLayerPath,
const QString &  baseName,
const QString &  providerKey 
)
pure virtualslot

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).

◆ addVectorTileLayer

virtual QgsVectorTileLayer * QgisInterface::addVectorTileLayer ( const QString &  url,
const QString &  baseName 
)
pure virtualslot

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).

Since
QGIS 3.14

◆ addVectorToolBarIcon

virtual int QgisInterface::addVectorToolBarIcon ( QAction *  qAction)
pure virtualslot

Add an icon to the Vector toolbar.

◆ addVectorToolBarWidget

virtual QAction * QgisInterface::addVectorToolBarWidget ( QWidget *  widget)
pure virtualslot

Add a widget to the vector toolbar.

To remove this widget again, call removeVectorToolBarIcon() with the returned QAction.

Parameters
widgetwidget to add. The toolbar will take ownership of this widget
Returns
the QAction you can use to remove this widget from the toolbar

◆ addWebToolBarIcon

virtual int QgisInterface::addWebToolBarIcon ( QAction *  qAction)
pure virtualslot

Add an icon to the Web toolbar.

◆ addWebToolBarWidget

virtual QAction * QgisInterface::addWebToolBarWidget ( QWidget *  widget)
pure virtualslot

Add a widget to the web toolbar.

To remove this widget again, call removeWebToolBarIcon() with the returned QAction.

Parameters
widgetwidget to add. The toolbar will take ownership of this widget
Returns
the QAction you can use to remove this widget from the toolbar

◆ addWindow

virtual void QgisInterface::addWindow ( QAction *  action)
pure virtualslot

Add window to Window menu.

The action title is the window title and the action should raise, unminimize and activate the window.

◆ advancedDigitizeToolBar()

virtual QToolBar * QgisInterface::advancedDigitizeToolBar ( )
pure virtual

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

◆ askForDatumTransform

virtual bool QgisInterface::askForDatumTransform ( QgsCoordinateReferenceSystem  sourceCrs,
QgsCoordinateReferenceSystem  destinationCrs 
)
pure virtualslot

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.

Returns
true if a datum transform has been specifically chosen by user or only one is available.
Since
3.0

◆ attributesToolBar()

virtual QToolBar * QgisInterface::attributesToolBar ( )
pure virtual

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

◆ browserModel

virtual QgsBrowserGuiModel * QgisInterface::browserModel ( )
pure virtualslot

Returns the application browser model.

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

Since
QGIS 3.4

◆ buildStyleSheet

virtual void QgisInterface::buildStyleSheet ( const QMap< QString, QVariant > &  opts)
pure virtualslot

Generate stylesheet.

Parameters
optsgenerated default option values, or a changed copy of them

◆ cadDockWidget()

virtual QgsAdvancedDigitizingDockWidget * QgisInterface::cadDockWidget ( )
pure virtual

Advanced digitizing dock widget.

Since
QGIS 2.12

◆ closeMapCanvas()

virtual void QgisInterface::closeMapCanvas ( const QString &  name)
pure virtual

Closes the additional map canvas with matching name.

See also
createNewMapCanvas()
Since
QGIS 3.0

◆ copySelectionToClipboard

virtual void QgisInterface::copySelectionToClipboard ( QgsMapLayer )
pure virtualslot

Copy selected features from the layer to clipboard.

Since
QGIS 3.0

◆ createNewMapCanvas()

virtual QgsMapCanvas * QgisInterface::createNewMapCanvas ( const QString &  name)
pure virtual

Create a new map canvas with the specified unique name.

See also
closeMapCanvas()
Since
QGIS 3.0

◆ currentLayerChanged

void QgisInterface::currentLayerChanged ( QgsMapLayer layer)
signal

Emitted whenever current (selected) layer changes.

The pointer to layer can be nullptr if no layer is selected.

◆ currentThemeChanged

void QgisInterface::currentThemeChanged ( const QString &  theme)
signal

Emitted when the current theme is changed so plugins can change their tool button icons.

Since
QGIS 3.0

◆ databaseMenu()

virtual QMenu * QgisInterface::databaseMenu ( )
pure virtual

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

◆ databaseToolBar()

virtual QToolBar * QgisInterface::databaseToolBar ( )
pure virtual

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

◆ dataSourceManagerToolBar()

virtual QToolBar * QgisInterface::dataSourceManagerToolBar ( )
pure virtual

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

Since
QGIS 3.4

◆ defaultStyleSheetFont()

virtual QFont QgisInterface::defaultStyleSheetFont ( )
pure virtual

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

◆ defaultStyleSheetOptions()

virtual QMap< QString, QVariant > QgisInterface::defaultStyleSheetOptions ( )
pure virtual

Returns changeable options built from settings and/or defaults.

◆ deregisterLocatorFilter

virtual void QgisInterface::deregisterLocatorFilter ( QgsLocatorFilter filter)
pure virtualslot

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.

See also
registerLocatorFilter()
Since
QGIS 3.0

◆ digitizeToolBar()

virtual QToolBar * QgisInterface::digitizeToolBar ( )
pure virtual

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

◆ editableLayers()

virtual QList< QgsMapLayer * > QgisInterface::editableLayers ( bool  modified = false) const
pure virtual

Returns vector layers in edit mode.

Parameters
modifiedwhether to return only layers that have been modified
Returns
list of layers in legend order, or empty list

◆ editMenu()

virtual QMenu * QgisInterface::editMenu ( )
pure virtual

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

◆ fileToolBar()

virtual QToolBar * QgisInterface::fileToolBar ( )
pure virtual

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

◆ firstRightStandardMenu()

virtual QMenu * QgisInterface::firstRightStandardMenu ( )
pure virtual

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.

◆ getFeatureForm

virtual QgsAttributeDialog * QgisInterface::getFeatureForm ( QgsVectorLayer l,
QgsFeature f 
)
pure virtualslot

Returns a feature form for a given feature.

Parameters
lThe layer for which the dialog will be created
fThe feature for which the dialog will be created
Returns
A feature form

◆ helpMenu()

virtual QMenu * QgisInterface::helpMenu ( )
pure virtual

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

◆ helpToolBar()

virtual QToolBar * QgisInterface::helpToolBar ( )
pure virtual

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

◆ iconSize()

virtual QSize QgisInterface::iconSize ( bool  dockedToolbar = false) const
pure virtual

Returns the toolbar icon size.

If dockedToolbar is true, the icon size for toolbars contained within docks is returned.

◆ initializationCompleted

void QgisInterface::initializationCompleted ( )
signal

Emitted when the initialization is complete.

◆ insertAddLayerAction

virtual void QgisInterface::insertAddLayerAction ( QAction *  action)
pure virtualslot

Add "add layer" action to layer menu.

◆ invalidateLocatorResults

virtual void QgisInterface::invalidateLocatorResults ( )
pure virtualslot

Invalidate results from the locator filter.

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

Since
QGIS 3.2

◆ layerMenu()

virtual QMenu * QgisInterface::layerMenu ( )
pure virtual

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

◆ layerSavedAs

void QgisInterface::layerSavedAs ( QgsMapLayer l,
const QString &  path 
)
signal

Emitted when a layer has been saved using save as.

Since
QGIS 2.7

◆ layerToolBar()

virtual QToolBar * QgisInterface::layerToolBar ( )
pure virtual

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

◆ layerTreeCanvasBridge()

virtual QgsLayerTreeMapCanvasBridge * QgisInterface::layerTreeCanvasBridge ( )
pure virtual

Returns a pointer to the layer tree canvas bridge.

Since
QGIS 2.12

◆ layerTreeInsertionPoint()

virtual QgsLayerTreeRegistryBridge::InsertionPoint QgisInterface::layerTreeInsertionPoint ( )
pure virtual

Returns the insertion point.

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

Since
QGIS 3.10

◆ layerTreeView()

virtual QgsLayerTreeView * QgisInterface::layerTreeView ( )
pure virtual

◆ layoutDesignerClosed

void QgisInterface::layoutDesignerClosed ( )
signal

Emitted after a layout designer window is closed.

See also
layoutDesignerWillBeClosed()
layoutDesignerOpened()
Since
QGIS 3.0

◆ layoutDesignerOpened

void QgisInterface::layoutDesignerOpened ( QgsLayoutDesignerInterface designer)
signal

Emitted when a new layout designer has been opened.

See also
layoutDesignerWillBeClosed()
Since
QGIS 3.0

◆ layoutDesignerWillBeClosed

void QgisInterface::layoutDesignerWillBeClosed ( QgsLayoutDesignerInterface designer)
signal

Emitted before a layout designer is going to be closed and deleted.

See also
layoutDesignerClosed()
layoutDesignerOpened()
Since
QGIS 3.0

◆ locatorSearch

virtual void QgisInterface::locatorSearch ( const QString &  searchText)
pure virtualslot

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

Since
QGIS 3.10

◆ mainWindow()

virtual QWidget * QgisInterface::mainWindow ( )
pure virtual

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

◆ mapCanvas()

virtual QgsMapCanvas * QgisInterface::mapCanvas ( )
pure virtual

Returns a pointer to the map canvas.

◆ mapCanvases()

virtual QList< QgsMapCanvas * > QgisInterface::mapCanvases ( )
pure virtual

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

Since
QGIS 3.0

◆ mapNavToolToolBar()

virtual QToolBar * QgisInterface::mapNavToolToolBar ( )
pure virtual

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

◆ mapToolActionGroup()

virtual QActionGroup * QgisInterface::mapToolActionGroup ( )
pure virtual

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.

Since
QGIS 3.16

◆ messageBar()

virtual QgsMessageBar * QgisInterface::messageBar ( )
pure virtual

Returns the message bar of the main app.

◆ messageTimeout()

virtual int QgisInterface::messageTimeout ( )
pure virtual

Returns the timeout for timed messages: default of 5 seconds.

◆ newLayerMenu()

virtual QMenu * QgisInterface::newLayerMenu ( )
pure virtual

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

◆ newProject

virtual bool QgisInterface::newProject ( bool  promptToSaveFlag = false)
pure virtualslot

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).

◆ newProjectCreated

void QgisInterface::newProjectCreated ( )
signal

Emitted when starting an entirely new project.

Note
This is similar to projectRead(); plugins might want to be notified that they're in a new project. Yes, projectRead() could have been overloaded to be used in the case of new projects instead. However, it's probably more semantically correct to have an entirely separate signal for when this happens.

◆ openDataSourceManagerPage()

virtual void QgisInterface::openDataSourceManagerPage ( const QString &  pageName)
pure virtual

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

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

Since
QGIS 3.30

◆ openFeatureForm

virtual bool QgisInterface::openFeatureForm ( QgsVectorLayer l,
QgsFeature f,
bool  updateFeatureOnly = false,
bool  showModal = true 
)
pure virtualslot

Opens a new feature form.

Returns true if dialog was accepted (if shown modal, TRUE otherwise).

Parameters
lvector layer
ffeature to show/modify
updateFeatureOnlyonly update the feature update (don't change any attributes of the layer) [UNUSED]
showModalif true, will wait for the dialog to be executed (only shown otherwise)

◆ openLayoutDesigner

virtual QgsLayoutDesignerInterface * QgisInterface::openLayoutDesigner ( QgsMasterLayoutInterface layout)
pure virtualslot

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.

Since
QGIS 3.0

◆ openLayoutDesigners()

virtual QList< QgsLayoutDesignerInterface * > QgisInterface::openLayoutDesigners ( )
pure virtual

Returns all currently open layout designers.

Since
QGIS 3.0

◆ openMessageLog

virtual void QgisInterface::openMessageLog ( )
pure virtualslot

Opens the message log dock widget.

◆ openURL

virtual Q_DECL_DEPRECATED void QgisInterface::openURL ( const QString &  url,
bool  useQgisDocDirectory = true 
)
pure virtualslot

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
urlURL to open
useQgisDocDirectoryIf true, the URL will be formed by concatenating url to the QGIS documentation directory path (prefix/share/doc)
Deprecated:
Use QDesktopServices instead

◆ pasteFromClipboard

virtual void QgisInterface::pasteFromClipboard ( QgsMapLayer )
pure virtualslot

Paste features from clipboard to the layer.

Since
QGIS 3.0

◆ pluginHelpMenu()

virtual QMenu * QgisInterface::pluginHelpMenu ( )
pure virtual

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.

Since
QGIS 3.10

◆ pluginManagerInterface()

virtual QgsPluginManagerInterface * QgisInterface::pluginManagerInterface ( )
pure virtual

◆ pluginMenu()

virtual QMenu * QgisInterface::pluginMenu ( )
pure virtual

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

◆ pluginToolBar()

virtual QToolBar * QgisInterface::pluginToolBar ( )
pure virtual

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

◆ preloadForm

virtual void QgisInterface::preloadForm ( const QString &  uifile)
pure virtualslot

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/

◆ projectImportExportMenu()

virtual QMenu * QgisInterface::projectImportExportMenu ( )
pure virtual

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

See also
addProjectImportAction()
addProjectExportAction
Since
QGIS 3.30

◆ projectMenu()

virtual QMenu * QgisInterface::projectMenu ( )
pure virtual

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

◆ projectRead

void QgisInterface::projectRead ( )
signal

Emitted when a project file is successfully read.

Note
This is useful for plugins that store properties with project files. A plugin can connect to this signal. When it is emitted the plugin knows to then check the project properties for any relevant state.

◆ rasterMenu()

virtual QMenu * QgisInterface::rasterMenu ( )
pure virtual

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

◆ rasterToolBar()

virtual QToolBar * QgisInterface::rasterToolBar ( )
pure virtual

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

◆ registerApplicationExitBlocker

virtual void QgisInterface::registerApplicationExitBlocker ( QgsApplicationExitBlockerInterface blocker)
pure virtualslot

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.
See also
unregisterApplicationExitBlocker()
Since
QGIS 3.16

◆ registerCustomDropHandler

virtual void QgisInterface::registerCustomDropHandler ( QgsCustomDropHandler handler)
pure virtualslot

Register a new custom drop handler.

Note
Ownership of handler is not transferred, and the handler must be unregistered when plugin is unloaded.
See also
QgsCustomDropHandler
unregisterCustomDropHandler()
Since
QGIS 3.0

◆ registerCustomLayoutDropHandler

virtual void QgisInterface::registerCustomLayoutDropHandler ( QgsLayoutCustomDropHandler handler)
pure virtualslot

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.
See also
QgsLayoutCustomDropHandler
unregisterCustomLayoutDropHandler()
Since
QGIS 3.0

◆ registerCustomProjectOpenHandler

virtual void QgisInterface::registerCustomProjectOpenHandler ( QgsCustomProjectOpenHandler handler)
pure virtualslot

Register a new custom project open handler.

Note
Ownership of handler is not transferred, and the handler must be unregistered when plugin is unloaded.
See also
QgsCustomProjectOpenHandler
unregisterCustomProjectOpenHandler()
Since
QGIS 3.14

◆ registerDevToolWidgetFactory

virtual void QgisInterface::registerDevToolWidgetFactory ( QgsDevToolWidgetFactory factory)
pure virtualslot

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.
See also
unregisterDevToolWidgetFactory()
Since
QGIS 3.14

◆ registerLocatorFilter

virtual void QgisInterface::registerLocatorFilter ( QgsLocatorFilter filter)
pure virtualslot

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.
See also
deregisterLocatorFilter()
Since
QGIS 3.0

◆ registerMainWindowAction

virtual bool QgisInterface::registerMainWindowAction ( QAction *  action,
const QString &  defaultShortcut 
)
pure virtualslot

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

◆ registerMapLayerConfigWidgetFactory

virtual void QgisInterface::registerMapLayerConfigWidgetFactory ( QgsMapLayerConfigWidgetFactory factory)
pure virtualslot

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.
See also
QgsMapLayerConfigWidgetFactory
unregisterMapLayerConfigWidgetFactory()
Since
QGIS 2.16

◆ registerMapToolHandler

virtual void QgisInterface::registerMapToolHandler ( QgsAbstractMapToolHandler handler)
pure virtualslot

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.
See also
QgsAbstractMapToolHandler
unregisterMapToolHandler()
Since
QGIS 3.16

◆ registerOptionsWidgetFactory

virtual void QgisInterface::registerOptionsWidgetFactory ( QgsOptionsWidgetFactory factory)
pure virtualslot

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.
See also
QgsOptionsWidgetFactory
unregisterOptionsWidgetFactory()
Since
QGIS 3.0

◆ registerProjectPropertiesWidgetFactory

virtual void QgisInterface::registerProjectPropertiesWidgetFactory ( QgsOptionsWidgetFactory factory)
pure virtualslot

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.
See also
QgsOptionsWidgetFactory
unregisterProjectPropertiesWidgetFactory()
Since
QGIS 3.16

◆ reloadConnections

virtual void QgisInterface::reloadConnections ( )
pure virtualslot

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)

Since
QGIS 3.0

◆ removeAddLayerAction

virtual void QgisInterface::removeAddLayerAction ( QAction *  action)
pure virtualslot

Remove "add layer" action from layer menu.

◆ removeCustomActionForLayerType()

virtual bool QgisInterface::removeCustomActionForLayerType ( QAction *  action)
pure virtual

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

See also
addCustomActionForLayerType()

◆ removeDatabaseToolBarIcon

virtual void QgisInterface::removeDatabaseToolBarIcon ( QAction *  qAction)
pure virtualslot

Remove an action (icon) from the Database toolbar.

◆ removeDockWidget

virtual void QgisInterface::removeDockWidget ( QDockWidget *  dockwidget)
pure virtualslot

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

See also
addDockWidget()

◆ removePluginDatabaseMenu

virtual void QgisInterface::removePluginDatabaseMenu ( const QString &  name,
QAction *  action 
)
pure virtualslot

Remove action from the Database menu.

◆ removePluginMenu

virtual void QgisInterface::removePluginMenu ( const QString &  name,
QAction *  action 
)
pure virtualslot

Remove action from the plugins menu.

◆ removePluginMeshMenu

virtual void QgisInterface::removePluginMeshMenu ( const QString &  name,
QAction *  action 
)
pure virtualslot

Remove action from the Mesh menu.

Since
QGIS 3.24

◆ removePluginRasterMenu

virtual void QgisInterface::removePluginRasterMenu ( const QString &  name,
QAction *  action 
)
pure virtualslot

Remove action from the Raster menu.

◆ removePluginVectorMenu

virtual void QgisInterface::removePluginVectorMenu ( const QString &  name,
QAction *  action 
)
pure virtualslot

Remove action from the Vector menu.

◆ removePluginWebMenu

virtual void QgisInterface::removePluginWebMenu ( const QString &  name,
QAction *  action 
)
pure virtualslot

Remove action from the Web menu.

◆ removeProjectExportAction()

virtual void QgisInterface::removeProjectExportAction ( QAction *  action)
pure virtual

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

See also
addProjectExportAction()
removeProjectImportAction()
Since
QGIS 3.30

◆ removeProjectImportAction()

virtual void QgisInterface::removeProjectImportAction ( QAction *  action)
pure virtual

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

See also
addProjectImportAction()
removeProjectExportAction()
Since
QGIS 3.30

◆ removeRasterToolBarIcon

virtual void QgisInterface::removeRasterToolBarIcon ( QAction *  qAction)
pure virtualslot

Remove an action (icon) from the Raster toolbar.

◆ removeToolBarIcon

virtual void QgisInterface::removeToolBarIcon ( QAction *  qAction)
pure virtualslot

Remove an action (icon) from the plugin toolbar.

◆ removeVectorToolBarIcon

virtual void QgisInterface::removeVectorToolBarIcon ( QAction *  qAction)
pure virtualslot

Remove an action (icon) from the Vector toolbar.

◆ removeWebToolBarIcon

virtual void QgisInterface::removeWebToolBarIcon ( QAction *  qAction)
pure virtualslot

Remove an action (icon) from the Web toolbar.

◆ removeWindow

virtual void QgisInterface::removeWindow ( QAction *  action)
pure virtualslot

Remove window from Window menu.

Calling this is necessary only for windows which are hidden rather than deleted when closed.

◆ saveStyleSheetOptions

virtual void QgisInterface::saveStyleSheetOptions ( const QMap< QString, QVariant > &  opts)
pure virtualslot

Save changed default option keys/values to user settings.

◆ selectionToolBar()

virtual QToolBar * QgisInterface::selectionToolBar ( )
pure virtual

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

Since
QGIS 3.14

◆ setActiveLayer

virtual bool QgisInterface::setActiveLayer ( QgsMapLayer )
pure virtualslot

Set the active layer (layer gets selected in the legend) returns true if the layer exists, false otherwise.

◆ setGpsPanelConnection

virtual void QgisInterface::setGpsPanelConnection ( QgsGpsConnection connection)
pure virtualslot

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().

Since
QGIS 3.16

◆ settingsMenu()

virtual QMenu * QgisInterface::settingsMenu ( )
pure virtual

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

◆ shapeDigitizeToolBar()

virtual QToolBar * QgisInterface::shapeDigitizeToolBar ( )
pure virtual

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

Since
QGIS 3.0

◆ showAttributeTable

virtual QDialog * QgisInterface::showAttributeTable ( QgsVectorLayer l,
const QString &  filterExpression = QString() 
)
pure virtualslot

Open attribute table dialog.

◆ showLayerProperties

virtual void QgisInterface::showLayerProperties ( QgsMapLayer l,
const QString &  page = QString() 
)
pure virtualslot

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.
More strings may be available depending on the context, e.g. via plugins.

◆ showLayoutManager

virtual void QgisInterface::showLayoutManager ( )
pure virtualslot

Opens the layout manager dialog.

Since
QGIS 3.0

◆ showOptionsDialog

virtual void QgisInterface::showOptionsDialog ( QWidget *  parent = nullptr,
const QString &  currentPage = QString() 
)
pure virtualslot

Opens the options dialog.

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

Since
QGIS 3.0

◆ showProjectPropertiesDialog

virtual void QgisInterface::showProjectPropertiesDialog ( const QString &  currentPage = QString())
pure virtualslot

Opens the project properties dialog.

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

Since
QGIS 3.16

◆ statusBarIface()

virtual QgsStatusBar * QgisInterface::statusBarIface ( )
pure virtual

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).

Since
QGIS 3.0

◆ takeAppScreenShots()

virtual void QgisInterface::takeAppScreenShots ( const QString &  saveDirectory,
const int  categories = 0 
)
inlinevirtual

Take screenshots for user documentation.

Parameters
saveDirectorypath where the screenshots will be saved
categoriesan int as a flag value of QgsAppScreenShots::Categories
Since
QGIS 3.4

Definition at line 793 of file qgisinterface.h.

◆ unregisterApplicationExitBlocker

virtual void QgisInterface::unregisterApplicationExitBlocker ( QgsApplicationExitBlockerInterface blocker)
pure virtualslot

Unregister a previously registered application exit blocker.

See also
registerApplicationExitBlocker()
Since
QGIS 3.16

◆ unregisterCustomDropHandler

virtual void QgisInterface::unregisterCustomDropHandler ( QgsCustomDropHandler handler)
pure virtualslot

Unregister a previously registered custom drop handler.

See also
QgsCustomDropHandler
registerCustomDropHandler()
Since
QGIS 3.0

◆ unregisterCustomLayoutDropHandler

virtual void QgisInterface::unregisterCustomLayoutDropHandler ( QgsLayoutCustomDropHandler handler)
pure virtualslot

Unregister a previously registered custom drop handler for layout windows.

See also
QgsLayoutCustomDropHandler
registerCustomLayoutDropHandler()
Since
QGIS 3.0

◆ unregisterCustomProjectOpenHandler

virtual void QgisInterface::unregisterCustomProjectOpenHandler ( QgsCustomProjectOpenHandler handler)
pure virtualslot

Unregister a previously registered custom project open handler.

See also
QgsCustomDropHandler
registerCustomProjectOpenHandler()
Since
QGIS 3.14

◆ unregisterDevToolWidgetFactory

virtual void QgisInterface::unregisterDevToolWidgetFactory ( QgsDevToolWidgetFactory factory)
pure virtualslot

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

See also
registerDevToolWidgetFactory()
Since
QGIS 3.14

◆ unregisterMainWindowAction

virtual bool QgisInterface::unregisterMainWindowAction ( QAction *  action)
pure virtualslot

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

◆ unregisterMapLayerConfigWidgetFactory

virtual void QgisInterface::unregisterMapLayerConfigWidgetFactory ( QgsMapLayerConfigWidgetFactory factory)
pure virtualslot

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

See also
QgsMapLayerConfigWidgetFactory
registerMapLayerConfigWidgetFactory()
Since
QGIS 2.16

◆ unregisterMapToolHandler

virtual void QgisInterface::unregisterMapToolHandler ( QgsAbstractMapToolHandler handler)
pure virtualslot

Unregister a previously registered map tool handler.

See also
registerMapToolHandler()
Since
QGIS 3.16

◆ unregisterOptionsWidgetFactory

virtual void QgisInterface::unregisterOptionsWidgetFactory ( QgsOptionsWidgetFactory factory)
pure virtualslot

Unregister a previously registered tab in the options dialog.

See also
QgsOptionsWidgetFactory
registerOptionsWidgetFactory()
Since
QGIS 3.0

◆ unregisterProjectPropertiesWidgetFactory

virtual void QgisInterface::unregisterProjectPropertiesWidgetFactory ( QgsOptionsWidgetFactory factory)
pure virtualslot

Unregister a previously registered tab in the options dialog.

See also
QgsOptionsWidgetFactory
registerProjectPropertiesWidgetFactory()
Since
QGIS 3.16

◆ userProfileManager()

virtual QgsUserProfileManager * QgisInterface::userProfileManager ( )
pure virtual

Returns a reference to the user profile manager.

Since
QGIS 3.30

◆ vectorLayerTools()

virtual QgsVectorLayerTools * QgisInterface::vectorLayerTools ( )
pure virtual

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.

Returns
An instance of the vector layer tools

◆ vectorMenu()

virtual QMenu * QgisInterface::vectorMenu ( )
pure virtual

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

◆ vectorToolBar()

virtual QToolBar * QgisInterface::vectorToolBar ( )
pure virtual

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

◆ viewMenu()

virtual QMenu * QgisInterface::viewMenu ( )
pure virtual

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

◆ webMenu()

virtual QMenu * QgisInterface::webMenu ( )
pure virtual

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

◆ webToolBar()

virtual QToolBar * QgisInterface::webToolBar ( )
pure virtual

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

◆ windowMenu()

virtual QMenu * QgisInterface::windowMenu ( )
pure virtual

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

◆ zoomFull

virtual void QgisInterface::zoomFull ( )
pure virtualslot

Zooms to the full extent of all map layers.

◆ zoomToActiveLayer

virtual void QgisInterface::zoomToActiveLayer ( )
pure virtualslot

Zooms to extent of the active layer.

◆ zoomToNext

virtual void QgisInterface::zoomToNext ( )
pure virtualslot

Zooms to the next view extent.

◆ zoomToPrevious

virtual void QgisInterface::zoomToPrevious ( )
pure virtualslot

Zooms to the previous view extent.


The documentation for this class was generated from the following file: