QGIS API Documentation  3.6.0-Noosa (5873452)
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. More...
 
virtual QAction * addDatabaseToolBarWidget (QWidget *widget)=0
 Add a widget to the database toolbar. More...
 
virtual void addDockWidget (Qt::DockWidgetArea area, QDockWidget *dockwidget)=0
 Adds a dock widget to the main window, in the specified dock area. More...
 
virtual QgsMeshLayeraddMeshLayer (const QString &url, const QString &baseName, const QString &providerKey)=0
 Adds a mesh layer to the current project. More...
 
virtual void addPluginToDatabaseMenu (const QString &name, QAction *action)=0
 Add action to the Database menu. More...
 
virtual void addPluginToMenu (const QString &name, QAction *action)=0
 Add action to the plugins menu. More...
 
virtual void addPluginToRasterMenu (const QString &name, QAction *action)=0
 Add action to the Raster menu. More...
 
virtual void addPluginToVectorMenu (const QString &name, QAction *action)=0
 Add action to the Vector menu. More...
 
virtual void addPluginToWebMenu (const QString &name, QAction *action)=0
 Add action to the Web menu. More...
 
virtual bool addProject (const QString &project)=0
 Adds (opens) a project. More...
 
virtual QgsRasterLayeraddRasterLayer (const QString &rasterLayerPath, const QString &baseName=QString())=0
 Adds a raster layer to the current project, given a raster layer file name. More...
 
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. More...
 
virtual int addRasterToolBarIcon (QAction *qAction)=0
 Add an icon to the Raster toolbar. More...
 
virtual QAction * addRasterToolBarWidget (QWidget *widget)=0
 Add a widget to the raster toolbar. More...
 
virtual QToolBar * addToolBar (const QString &name)=0
 Add toolbar with specified name. More...
 
virtual void addToolBar (QToolBar *toolbar, Qt::ToolBarArea area=Qt::TopToolBarArea)=0
 Add a toolbar. More...
 
virtual int addToolBarIcon (QAction *qAction)=0
 Add an icon to the plugins toolbar. More...
 
virtual QAction * addToolBarWidget (QWidget *widget)=0
 Add a widget to the plugins toolbar. More...
 
virtual void addUserInputWidget (QWidget *widget)=0
 Adds a widget to the user input tool bar. More...
 
virtual QgsVectorLayeraddVectorLayer (const QString &vectorLayerPath, const QString &baseName, const QString &providerKey)=0
 Adds a vector layer to the current project. More...
 
virtual int addVectorToolBarIcon (QAction *qAction)=0
 Add an icon to the Vector toolbar. More...
 
virtual QAction * addVectorToolBarWidget (QWidget *widget)=0
 Add a widget to the vector toolbar. More...
 
virtual int addWebToolBarIcon (QAction *qAction)=0
 Add an icon to the Web toolbar. More...
 
virtual QAction * addWebToolBarWidget (QWidget *widget)=0
 Add a widget to the web toolbar. More...
 
virtual void addWindow (QAction *action)=0
 Add window to Window menu. More...
 
virtual bool askForDatumTransform (QgsCoordinateReferenceSystem sourceCrs, QgsCoordinateReferenceSystem destinationCrs)=0
 Checks available datum transforms and ask user if several are available and none is chosen. More...
 
virtual QgsBrowserModelbrowserModel ()=0
 Returns the application browser model. More...
 
virtual void buildStyleSheet (const QMap< QString, QVariant > &opts)=0
 Generate stylesheet. More...
 
virtual void copySelectionToClipboard (QgsMapLayer *)=0
 Copy selected features from the layer to clipboard. More...
 
virtual void deregisterLocatorFilter (QgsLocatorFilter *filter)=0
 Deregisters a locator filter from the app's locator bar and deletes it. More...
 
virtual QgsAttributeDialoggetFeatureForm (QgsVectorLayer *l, QgsFeature &f)=0
 Returns a feature form for a given feature. More...
 
virtual void insertAddLayerAction (QAction *action)=0
 Add "add layer" action to layer menu. More...
 
virtual void invalidateLocatorResults ()=0
 Invalidate results from the locator filter. More...
 
virtual void newProject (bool promptToSaveFlag=false)=0
 Starts a new blank project. More...
 
virtual bool openFeatureForm (QgsVectorLayer *l, QgsFeature &f, bool updateFeatureOnly=false, bool showModal=true)=0
 Opens a new feature form. More...
 
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. More...
 
virtual void openMessageLog ()=0
 Opens the message log dock widget. More...
 
virtual Q_DECL_DEPRECATED void openURL (const QString &url, bool useQgisDocDirectory=true)=0
 Open a url in the users browser. More...
 
virtual void pasteFromClipboard (QgsMapLayer *)=0
 Paste features from clipboard to the layer. More...
 
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. More...
 
virtual void registerCustomDropHandler (QgsCustomDropHandler *handler)=0
 Register a new custom drop handler. More...
 
virtual void registerCustomLayoutDropHandler (QgsLayoutCustomDropHandler *handler)=0
 Register a new custom drop handler for layout windows. More...
 
virtual void registerLocatorFilter (QgsLocatorFilter *filter)=0
 Registers a locator filter for the app's locator bar. More...
 
virtual bool registerMainWindowAction (QAction *action, const QString &defaultShortcut)=0
 Register action to the shortcuts manager so its shortcut can be changed in GUI. More...
 
virtual void registerMapLayerConfigWidgetFactory (QgsMapLayerConfigWidgetFactory *factory)=0
 Register a new tab in the vector layer properties dialog. More...
 
virtual void registerOptionsWidgetFactory (QgsOptionsWidgetFactory *factory)=0
 Register a new tab in the options dialog. More...
 
virtual void reloadConnections ()=0
 Triggered when connections have changed. More...
 
virtual void removeAddLayerAction (QAction *action)=0
 Remove "add layer" action from layer menu. More...
 
virtual void removeDatabaseToolBarIcon (QAction *qAction)=0
 Remove an action (icon) from the Database toolbar. More...
 
virtual void removeDockWidget (QDockWidget *dockwidget)=0
 Removes the specified dock widget from main window (without deleting it). More...
 
virtual void removePluginDatabaseMenu (const QString &name, QAction *action)=0
 Remove action from the Database menu. More...
 
virtual void removePluginMenu (const QString &name, QAction *action)=0
 Remove action from the plugins menu. More...
 
virtual void removePluginRasterMenu (const QString &name, QAction *action)=0
 Remove action from the Raster menu. More...
 
virtual void removePluginVectorMenu (const QString &name, QAction *action)=0
 Remove action from the Vector menu. More...
 
virtual void removePluginWebMenu (const QString &name, QAction *action)=0
 Remove action from the Web menu. More...
 
virtual void removeRasterToolBarIcon (QAction *qAction)=0
 Remove an action (icon) from the Raster toolbar. More...
 
virtual void removeToolBarIcon (QAction *qAction)=0
 Remove an action (icon) from the plugin toolbar. More...
 
virtual void removeVectorToolBarIcon (QAction *qAction)=0
 Remove an action (icon) from the Vector toolbar. More...
 
virtual void removeWebToolBarIcon (QAction *qAction)=0
 Remove an action (icon) from the Web toolbar. More...
 
virtual void removeWindow (QAction *action)=0
 Remove window from Window menu. More...
 
virtual void saveStyleSheetOptions (const QMap< QString, QVariant > &opts)=0
 Save changed default option keys/values to user settings. More...
 
virtual bool setActiveLayer (QgsMapLayer *)=0
 Set the active layer (layer gets selected in the legend) returns true if the layer exists, false otherwise. More...
 
virtual QDialog * showAttributeTable (QgsVectorLayer *l, const QString &filterExpression=QString())=0
 Open attribute table dialog. More...
 
virtual void showLayerProperties (QgsMapLayer *l)=0
 Open layer properties dialog. More...
 
virtual void showLayoutManager ()=0
 Opens the layout manager dialog. More...
 
virtual void showOptionsDialog (QWidget *parent=nullptr, const QString &currentPage=QString())=0
 Opens the options dialog. More...
 
virtual void unregisterCustomDropHandler (QgsCustomDropHandler *handler)=0
 Unregister a previously registered custom drop handler. More...
 
virtual void unregisterCustomLayoutDropHandler (QgsLayoutCustomDropHandler *handler)=0
 Unregister a previously registered custom drop handler for layout windows. More...
 
virtual bool unregisterMainWindowAction (QAction *action)=0
 Unregister a previously registered action. (e.g. when plugin is going to be unloaded) More...
 
virtual void unregisterMapLayerConfigWidgetFactory (QgsMapLayerConfigWidgetFactory *factory)=0
 Unregister a previously registered tab in the vector layer properties dialog. More...
 
virtual void unregisterOptionsWidgetFactory (QgsOptionsWidgetFactory *factory)=0
 Unregister a previously registered tab in the options dialog. More...
 
virtual void zoomFull ()=0
 Zooms to the full extent of all map layers. More...
 
virtual void zoomToActiveLayer ()=0
 Zooms to extent of the active layer. More...
 
virtual void zoomToNext ()=0
 Zooms to the next view extent. More...
 
virtual void zoomToPrevious ()=0
 Zooms to the previous view extent. More...
 

Signals

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

Public Member Functions

 QgisInterface ()=default
 Constructor. More...
 
virtual QAction * actionAbout ()=0
 
virtual QAction * actionAddAfsLayer ()=0
 Returns the native Add ArcGIS FeatureServer action. More...
 
virtual QAction * actionAddAllToOverview ()=0
 
virtual QAction * actionAddAmsLayer ()=0
 Returns the native Add ArcGIS MapServer action. More...
 
virtual QAction * actionAddFeature ()=0
 Returns the native Add Feature action. More...
 
virtual QAction * actionAddOgrLayer ()=0
 
virtual QAction * actionAddPart ()=0
 Returns the native Add Part action. More...
 
virtual QAction * actionAddPgLayer ()=0
 
virtual QAction * actionAddRasterLayer ()=0
 
virtual QAction * actionAddRing ()=0
 Returns the native Add Ring action. More...
 
virtual QAction * actionAddToOverview ()=0
 
virtual QAction * actionAddWmsLayer ()=0
 
virtual QAction * actionAllEdits ()=0
 
virtual QAction * actionCancelAllEdits ()=0
 
virtual QAction * actionCancelEdits ()=0
 
virtual QAction * actionCheckQgisVersion ()=0
 
virtual QAction * actionCopyFeatures ()=0
 Returns the native Copy Features action. More...
 
virtual QAction * actionCopyLayerStyle ()=0
 
virtual QAction * actionCreatePrintLayout ()=0
 Create new print layout action. More...
 
virtual QAction * actionCustomProjection ()=0
 
virtual QAction * actionCutFeatures ()=0
 Returns the native Cut Features action. More...
 
virtual QAction * actionDeletePart ()=0
 Returns the native Delete Part action. More...
 
virtual QAction * actionDeleteRing ()=0
 Returns the native Delete Ring action. More...
 
virtual QAction * actionDeleteSelected ()=0
 Returns the native Delete Selected Features action. More...
 
virtual QAction * actionDraw ()=0
 Returns the native draw action. More...
 
virtual QAction * actionDuplicateLayer ()=0
 
virtual QAction * actionExit ()=0
 Returns the Exit QGIS action. More...
 
virtual QAction * actionFeatureAction ()=0
 Returns the native run action feature action. Call trigger() on it to set the default run feature action map tool. More...
 
virtual QAction * actionHelpContents ()=0
 
virtual QAction * actionHideAllLayers ()=0
 
virtual QAction * actionHideDeselectedLayers ()=0
 Returns the Hide Deselected Layers action. More...
 
virtual QAction * actionHideSelectedLayers ()=0
 
virtual QAction * actionIdentify ()=0
 Returns the native identify action. Call trigger() on it to set the default identify map tool. More...
 
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. More...
 
virtual QAction * actionMeasure ()=0
 Returns the native measure action. Call trigger() on it to set the default measure map tool. More...
 
virtual QAction * actionMeasureArea ()=0
 Returns the native measure area action. Call trigger() on it to set the default measure area map tool. More...
 
virtual QAction * actionMoveFeature ()=0
 Returns the native Move Features action. More...
 
virtual QAction * actionNewBookmark ()=0
 Returns the native new bookmark action. Call trigger() on it to open the new bookmark dialog. More...
 
virtual QAction * actionNewProject ()=0
 Returns the native New Project action. More...
 
virtual QAction * actionNewVectorLayer ()=0
 
virtual QAction * actionOpenFieldCalculator ()=0
 
virtual QAction * actionOpenProject ()=0
 Returns the Open Project action. More...
 
virtual QAction * actionOpenStatisticalSummary ()=0
 Statistical summary action. More...
 
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. More...
 
virtual QAction * actionPanToSelected ()=0
 Returns the native pan to selected action. Call trigger() on it to pan the map canvas to the selection. More...
 
virtual QAction * actionPasteFeatures ()=0
 Returns the native Paste Features action. More...
 
virtual QAction * actionPasteLayerStyle ()=0
 
virtual QAction * actionPluginListSeparator ()=0
 
virtual QAction * actionProjectProperties ()=0
 Returns the native Project Properties action. More...
 
virtual QAction * actionQgisHomePage ()=0
 
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. More...
 
virtual QAction * actionSaveProject ()=0
 Returns the native Save Project action. More...
 
virtual QAction * actionSaveProjectAs ()=0
 Returns the native Save Project As action. More...
 
virtual QAction * actionSelect ()=0
 Returns the native select action. Call trigger() on it to set the default select map tool. More...
 
virtual QAction * actionSelectFreehand ()=0
 Returns the native select freehand action. Call trigger() on it to set the default select freehand map tool. More...
 
virtual QAction * actionSelectPolygon ()=0
 Returns the native select polygon action. Call trigger() on it to set the default select polygon map tool. More...
 
virtual QAction * actionSelectRadius ()=0
 Returns the native select radius action. Call trigger() on it to set the default select radius map tool. More...
 
virtual QAction * actionSelectRectangle ()=0
 Returns the native select rectangle action. Call trigger() on it to set the default select rectangle map tool. More...
 
virtual QAction * actionShowAllLayers ()=0
 
virtual QAction * actionShowBookmarks ()=0
 Returns the native show bookmarks action. Call trigger() on it to open the bookmarks dialog. More...
 
virtual QAction * actionShowLayoutManager ()=0
 Show layout manager action. More...
 
virtual QAction * actionShowPythonDialog ()=0
 
virtual QAction * actionShowSelectedLayers ()=0
 
virtual QAction * actionSimplifyFeature ()=0
 Returns the native Simplify/Smooth Features action. More...
 
virtual QAction * actionSplitFeatures ()=0
 Returns the native Split Features action. More...
 
virtual QAction * actionSplitParts ()=0
 Returns the native Split Parts action. More...
 
virtual QAction * actionToggleEditing ()=0
 
virtual QAction * actionToggleFullScreen ()=0
 
virtual QAction * actionVertexTool ()=0
 Returns the native "Vertex Tool for All Layers" action. More...
 
virtual QAction * actionVertexToolActiveLayer ()=0
 Returns the native "Vertex Tool for Active Layer" action. More...
 
virtual QAction * actionZoomActualSize ()=0
 Returns the native zoom resolution (100%) action. Call trigger() on it to zoom to actual size. More...
 
virtual QAction * actionZoomFullExtent ()=0
 Returns the native zoom full extent action. Call trigger() on it to zoom to the full extent. More...
 
virtual QAction * actionZoomIn ()=0
 Returns the native zoom in action. Call trigger() on it to set the default zoom in map tool. More...
 
virtual QAction * actionZoomLast ()=0
 Returns the native zoom last action. Call trigger() on it to zoom to last. More...
 
virtual QAction * actionZoomNext ()=0
 Returns the native zoom next action. Call trigger() on it to zoom to next. More...
 
virtual QAction * actionZoomOut ()=0
 Returns the native zoom out action. Call trigger() on it to set the default zoom out map tool. More...
 
virtual QAction * actionZoomToLayer ()=0
 Returns the native zoom to layer action. Call trigger() on it to zoom to the active layer. More...
 
virtual QAction * actionZoomToSelected ()=0
 Returns the native zoom to selected action. Call trigger() on it to zoom to the current selection. More...
 
virtual QgsMapLayeractiveLayer ()=0
 Returns a pointer to the active layer (layer selected in the legend) More...
 
virtual void addCustomActionForLayer (QAction *action, QgsMapLayer *layer)=0
 Add action to context menu for a specific layer in the layer tree. More...
 
virtual void addCustomActionForLayerType (QAction *action, QString menu, QgsMapLayer::LayerType type, bool allLayers)=0
 Add action to context menu for layers in the layer tree. More...
 
virtual QMenu * addLayerMenu ()=0
 Returns a reference to the main window "Add Layer" menu. More...
 
virtual QToolBar * advancedDigitizeToolBar ()=0
 Returns a reference to the main window "Advanced Digitizing" toolbar. More...
 
virtual QToolBar * attributesToolBar ()=0
 Returns a reference to the main window "Attributes" toolbar. More...
 
virtual QgsAdvancedDigitizingDockWidgetcadDockWidget ()=0
 Advanced digitizing dock widget. More...
 
virtual void closeMapCanvas (const QString &name)=0
 Closes the additional map canvas with matching name. More...
 
virtual QgsMapCanvascreateNewMapCanvas (const QString &name)=0
 Create a new map canvas with the specified unique name. More...
 
virtual QMenu * databaseMenu ()=0
 Returns a reference to the main window "Database" menu. More...
 
virtual QToolBar * databaseToolBar ()=0
 Returns a reference to the main window "Database" toolbar. More...
 
virtual QToolBar * dataSourceManagerToolBar ()=0
 Returns a reference to the main window "Data Source Manager" toolbar. More...
 
virtual QFont defaultStyleSheetFont ()=0
 Returns a reference font for initial qApp (may not be same as QgisApp) More...
 
virtual QMap< QString, QVariant > defaultStyleSheetOptions ()=0
 Returns changeable options built from settings and/or defaults. More...
 
virtual QToolBar * digitizeToolBar ()=0
 Returns a reference to the main window "Digitize" toolbar. More...
 
virtual QList< QgsMapLayer * > editableLayers (bool modified=false) const =0
 Returns vector layers in edit mode. More...
 
virtual QMenu * editMenu ()=0
 Returns a reference to the main window "Edit" menu. More...
 
virtual QToolBar * fileToolBar ()=0
 Returns a reference to the main window "File" toolbar. More...
 
virtual QMenu * firstRightStandardMenu ()=0
 Returns a reference to the right most standard menu, which is usually the last menu item before the "Help" menu. More...
 
virtual QMenu * helpMenu ()=0
 Returns a reference to the main window "Help" menu. More...
 
virtual QToolBar * helpToolBar ()=0
 Returns a reference to the main window "Help" toolbar. More...
 
virtual QSize iconSize (bool dockedToolbar=false) const =0
 Returns the toolbar icon size. More...
 
virtual QMenu * layerMenu ()=0
 Returns a reference to the main window "Layer" menu. More...
 
virtual QToolBar * layerToolBar ()=0
 Returns a reference to the main window "Layer" toolbar. More...
 
virtual QgsLayerTreeMapCanvasBridgelayerTreeCanvasBridge ()=0
 Returns a pointer to the layer tree canvas bridge. More...
 
virtual QgsLayerTreeViewlayerTreeView ()=0
 
virtual QWidget * mainWindow ()=0
 Returns a pointer to the main window (instance of QgisApp in case of QGIS) More...
 
virtual QgsMapCanvasmapCanvas ()=0
 Returns a pointer to the map canvas. More...
 
virtual QList< QgsMapCanvas *> mapCanvases ()=0
 Returns a list of all map canvases open in the app. More...
 
virtual QToolBar * mapNavToolToolBar ()=0
 Returns a reference to the main window "Map Navigation" toolbar. More...
 
virtual QgsMessageBarmessageBar ()=0
 Returns the message bar of the main app. More...
 
virtual int messageTimeout ()=0
 Returns the timeout for timed messages: default of 5 seconds. More...
 
virtual QMenu * newLayerMenu ()=0
 Returns a reference to the main window "Create New Layer" menu. More...
 
virtual QList< QgsLayoutDesignerInterface * > openLayoutDesigners ()=0
 Returns all currently open layout designers. More...
 
virtual QgsPluginManagerInterfacepluginManagerInterface ()=0
 
virtual QMenu * pluginMenu ()=0
 Returns a reference to the main window "Plugin" menu. More...
 
virtual QToolBar * pluginToolBar ()=0
 Returns a reference to the main window "Plugin" toolbar. More...
 
virtual QMenu * projectMenu ()=0
 Returns a reference to the main window "Project" menu. More...
 
virtual QMenu * rasterMenu ()=0
 Returns a reference to the main window "Raster" menu. More...
 
virtual QToolBar * rasterToolBar ()=0
 Returns a reference to the main window "Raster" toolbar. More...
 
virtual bool removeCustomActionForLayerType (QAction *action)=0
 Remove action for layers in the layer tree previously added with addCustomActionForLayerType() More...
 
virtual QMenu * settingsMenu ()=0
 Returns a reference to the main window "Settings" menu. More...
 
virtual QToolBar * shapeDigitizeToolBar ()=0
 Returns a reference to the main window "Shape Digitizing" toolbar. More...
 
virtual QgsStatusBarstatusBarIface ()=0
 Returns a pointer to the app's status bar interface. More...
 
virtual void takeAppScreenShots (const QString &saveDirectory, const int categories=0)
 Take screenshots for user documentation. More...
 
virtual QgsVectorLayerToolsvectorLayerTools ()=0
 Access the vector layer tools instance. More...
 
virtual QMenu * vectorMenu ()=0
 Returns a reference to the main window "Vector" menu. More...
 
virtual QToolBar * vectorToolBar ()=0
 Returns a reference to the main window "Vector" toolbar. More...
 
virtual QMenu * viewMenu ()=0
 Returns a reference to the main window "View" menu. More...
 
virtual QMenu * webMenu ()=0
 Returns a reference to the main window "Web" menu. More...
 
virtual QToolBar * webToolBar ()=0
 Returns a reference to the main window "Web" toolbar. More...
 
virtual QMenu * windowMenu ()=0
 Returns a reference to the main window "Window" menu. More...
 

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 77 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 FeatureServer action.

◆ actionAddAllToOverview()

virtual QAction* QgisInterface::actionAddAllToOverview ( )
pure virtual

◆ actionAddAmsLayer()

virtual QAction* QgisInterface::actionAddAmsLayer ( )
pure virtual

Returns the native Add ArcGIS MapServer 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

◆ 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

◆ actionAddWmsLayer()

virtual QAction* QgisInterface::actionAddWmsLayer ( )
pure virtual

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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 QAction* QgisInterface::actionZoomToLayer ( )
pure virtual

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

◆ actionZoomToSelected()

virtual QAction* QgisInterface::actionZoomToSelected ( )
pure virtual

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

◆ 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,
QgsMapLayer::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
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.

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

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

◆ addProject

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

Adds (opens) a project.

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

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

◆ 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

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

◆ 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 QgsBrowserModel* 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 null if no layer is selected.

◆ currentThemeChanged

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

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

This signal is 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

This signal is 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

◆ layerTreeView()

virtual QgsLayerTreeView* QgisInterface::layerTreeView ( )
pure virtual

◆ layoutDesignerClosed

void QgisInterface::layoutDesignerClosed ( )
signal

This signal is emitted after a layout designer window is closed.

See also
layoutDesignerWillBeClosed()
layoutDesignerOpened()
Since
QGIS 3.0

◆ layoutDesignerOpened

void QgisInterface::layoutDesignerOpened ( QgsLayoutDesignerInterface designer)
signal

This signal is emitted when a new layout designer has been opened.

See also
layoutDesignerWillBeClosed()
Since
QGIS 3.0

◆ layoutDesignerWillBeClosed

void QgisInterface::layoutDesignerWillBeClosed ( QgsLayoutDesignerInterface designer)
signal

This signal is emitted before a layout designer is going to be closed and deleted.

See also
layoutDesignerClosed()
layoutDesignerOpened()
Since
QGIS 3.0

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

◆ 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 void QgisInterface::newProject ( bool  promptToSaveFlag = false)
pure virtualslot

Starts a new blank 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.

◆ 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

◆ 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/

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

◆ registerCustomDropHandler

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

Register a new custom drop handler.

Note
Ownership of the factory is not transferred, and the factory 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 the factory is not transferred, and the factory must be unregistered when plugin is unloaded.
See also
QgsLayoutCustomDropHandler
unregisterCustomLayoutDropHandler()
Since
QGIS 3.0

◆ 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 vector 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

◆ 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

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

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

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

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

◆ 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)
pure virtualslot

Open layer properties dialog.

◆ 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

◆ 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 549 of file qgisinterface.h.

◆ 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

◆ 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 vector layer properties dialog.

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

◆ 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: