QGIS API Documentation  master-3f58142
QgisInterface Class Reference

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

#include <qgisinterface.h>

List of all members.

Public Slots

virtual QAction * actionAbout ()=0
virtual QAction * actionAddAllToOverview ()=0
virtual QAction * actionAddFeature ()=0
virtual QAction * actionAddOgrLayer ()=0
virtual QAction * actionAddPart ()=0
virtual QAction * actionAddPgLayer ()=0
virtual QAction * actionAddRasterLayer ()=0
virtual QAction * actionAddRing ()=0
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
virtual QAction * actionCopyLayerStyle ()=0
virtual QAction * actionCustomProjection ()=0
virtual QAction * actionCutFeatures ()=0
 Edit menu actions.
virtual QAction * actionDeletePart ()=0
virtual QAction * actionDeleteRing ()=0
virtual QAction * actionDeleteSelected ()=0
virtual QAction * actionDraw ()=0
virtual QAction * actionDuplicateLayer ()=0
virtual QAction * actionExit ()=0
virtual QAction * actionHelpContents ()=0
 Help menu actions.
virtual QAction * actionHideAllLayers ()=0
virtual QAction * actionIdentify ()=0
virtual QAction * actionLayerProperties ()=0
virtual QAction * actionLayerSaveAs ()=0
virtual QAction * actionLayerSelectionSaveAs ()=0
virtual QAction * actionManagePlugins ()=0
 Plugin menu actions.
virtual QAction * actionMapTips ()=0
virtual QAction * actionMeasure ()=0
virtual QAction * actionMeasureArea ()=0
virtual QAction * actionMoveFeature ()=0
virtual QAction * actionNewBookmark ()=0
virtual QAction * actionNewProject ()=0
 File menu actions.
virtual QAction * actionNewVectorLayer ()=0
 Layer menu actions.
virtual QAction * actionNodeTool ()=0
virtual QAction * actionOpenFieldCalculator ()=0
virtual QAction * actionOpenProject ()=0
virtual QAction * actionOpenTable ()=0
virtual QAction * actionOptions ()=0
virtual QAction * actionPan ()=0
 View menu actions.
virtual QAction * actionPanToSelected ()=0
virtual QAction * actionPasteFeatures ()=0
virtual QAction * actionPasteLayerStyle ()=0
virtual QAction * actionPluginListSeparator ()=0
virtual QAction * actionPrintComposer ()=0
virtual QAction * actionProjectProperties ()=0
virtual QAction * actionQgisHomePage ()=0
virtual QAction * actionRemoveAllFromOverview ()=0
virtual QAction * actionRemoveLayer ()=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
virtual QAction * actionSaveProject ()=0
virtual QAction * actionSaveProjectAs ()=0
virtual QAction * actionSelect ()=0
virtual QAction * actionSelectFreehand ()=0
virtual QAction * actionSelectPolygon ()=0
virtual QAction * actionSelectRadius ()=0
virtual QAction * actionSelectRectangle ()=0
virtual QAction * actionShowAllLayers ()=0
virtual QAction * actionShowBookmarks ()=0
virtual QAction * actionShowComposerManager ()=0
virtual QAction * actionShowPythonDialog ()=0
virtual QAction * actionSimplifyFeature ()=0
virtual QAction * actionSplitFeatures ()=0
virtual QAction * actionToggleEditing ()=0
virtual QAction * actionToggleFullScreen ()=0
 Settings menu actions.
virtual QAction * actionTouch ()=0
virtual QAction * actionZoomActualSize ()=0
virtual QAction * actionZoomFullExtent ()=0
virtual QAction * actionZoomIn ()=0
virtual QAction * actionZoomLast ()=0
virtual QAction * actionZoomOut ()=0
virtual QAction * actionZoomToLayer ()=0
virtual QAction * actionZoomToSelected ()=0
virtual QList< QgsComposerView * > activeComposers ()=0
 Return mainwindows / composer views of running composer instances (currently only one)
virtual QgsMapLayeractiveLayer ()=0
 Get pointer to the active layer (layer selected in the legend)
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
 Add a dock widget to the main window.
virtual void addPluginToDatabaseMenu (QString name, QAction *action)=0
 Add action to the Database menu.
virtual void addPluginToMenu (QString name, QAction *action)=0
 Add action to the plugins menu.
virtual void addPluginToRasterMenu (QString name, QAction *action)=0
 Add action to the Raster menu.
virtual void addPluginToVectorMenu (QString name, QAction *action)=0
 Add action to the Vector menu.
virtual void addPluginToWebMenu (QString name, QAction *action)=0
 Add action to the Web menu.
virtual bool addProject (QString theProject)=0
 Add a project.
virtual QgsRasterLayeraddRasterLayer (QString rasterLayerPath, QString baseName=QString())=0
 Add a raster layer given a raster layer file name.
virtual QgsRasterLayeraddRasterLayer (const QString &url, const QString &layerName, const QString &providerKey)=0
 Add a WMS layer.
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 QToolBar * addToolBar (QString name)=0
 Add toolbar with specified name.
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 QgsVectorLayeraddVectorLayer (QString vectorLayerPath, QString baseName, QString providerKey)=0
 Add a vector layer.
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 QToolBar * advancedDigitizeToolBar ()=0
virtual QToolBar * attributesToolBar ()=0
virtual void buildStyleSheet (const QMap< QString, QVariant > &opts)=0
 Generate stylesheet.
virtual QgsComposerViewcreateNewComposer (QString title=QString(""))=0
 Create a new composer.
virtual QMenu * databaseMenu ()=0
virtual QToolBar * databaseToolBar ()=0
virtual QFont defaultStyleSheetFont ()=0
 Get reference font for initial qApp (may not be same as QgisApp)
virtual QMap< QString, QVariant > defaultStyleSheetOptions ()=0
 Return changeable options built from settings and/or defaults.
virtual void deleteComposer (QgsComposerView *composerView)=0
 Deletes parent composer of composer view, after closing composer window.
virtual QToolBar * digitizeToolBar ()=0
virtual QgsComposerViewduplicateComposer (QgsComposerView *composerView, QString title=QString(""))=0
 Duplicate an existing parent composer from composer view.
virtual QList< QgsMapLayer * > editableLayers (bool modified=false) const =0
 Return vector layers in edit mode.
virtual QMenu * editMenu ()=0
virtual QMenu * fileMenu ()=0
 Accessors for inserting items into menus and toolbars.
virtual QToolBar * fileToolBar ()=0
 ToolBars.
virtual QMenu * firstRightStandardMenu ()=0
virtual QDialog * getFeatureForm (QgsVectorLayer *l, QgsFeature &f)=0
virtual QMenu * helpMenu ()=0
virtual QToolBar * helpToolBar ()=0
virtual void insertAddLayerAction (QAction *action)=0
 Add "add layer" action to layer menu.
virtual QMenu * layerMenu ()=0
virtual QToolBar * layerToolBar ()=0
virtual QWidget * mainWindow ()=0
 Return a pointer to the main window (instance of QgisApp in case of QGIS)
virtual QgsMapCanvasmapCanvas ()=0
 Return a pointer to the map canvas.
virtual QToolBar * mapNavToolToolBar ()=0
virtual QgsMessageBarmessageBar ()=0
 Return the message bar of the main app.
virtual int messageTimeout ()=0
 Get timeout for timed messages: default of 5 seconds.
virtual QMenu * newLayerMenu ()=0
virtual void newProject (bool thePromptToSaveFlag=false)=0
 Start a blank project.
virtual bool openFeatureForm (QgsVectorLayer *l, QgsFeature &f, bool updateFeatureOnly=false)=0
 Open feature form.
virtual Q_DECL_DEPRECATED void openURL (QString url, bool useQgisDocDirectory=true)=0
 Open a url in the users browser.
virtual QMenu * pluginMenu ()=0
virtual QToolBar * pluginToolBar ()=0
virtual void preloadForm (QString uifile)=0
virtual QMenu * rasterMenu ()=0
virtual QToolBar * rasterToolBar ()=0
virtual bool registerMainWindowAction (QAction *action, QString defaultShortcut)=0
 Register action to the shortcuts manager so its shortcut can be changed in GUI.
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
 Remove specified dock widget from main window (doesn't delete it).
virtual void removePluginDatabaseMenu (QString name, QAction *action)=0
 Remove action from the Database menu.
virtual void removePluginMenu (QString name, QAction *action)=0
 Remove action from the plugins menu.
virtual void removePluginRasterMenu (QString name, QAction *action)=0
 Remove action from the Raster menu.
virtual void removePluginVectorMenu (QString name, QAction *action)=0
 Remove action from the Vector menu.
virtual void removePluginWebMenu (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 added in 1.4.
virtual QMenu * settingsMenu ()=0
virtual void showAttributeTable (QgsVectorLayer *l)=0
 open attribute table dialog
virtual void showLayerProperties (QgsMapLayer *l)=0
 open layer properties dialog
virtual bool unregisterMainWindowAction (QAction *action)=0
 Unregister a previously registered action.
virtual QMenu * vectorMenu ()=0
virtual QToolBar * vectorToolBar ()=0
virtual QMenu * viewMenu ()=0
virtual QMenu * webMenu ()=0
virtual QToolBar * webToolBar ()=0
virtual QMenu * windowMenu ()=0
virtual void zoomFull ()=0
 Zoom to full extent of map layers.
virtual void zoomToActiveLayer ()=0
 Zoom to extent of the active layer.
virtual void zoomToNext ()=0
 Zoom to next view extent.
virtual void zoomToPrevious ()=0
 Zoom to previous view extent.

Signals

void composerAdded (QgsComposerView *v)
 This signal is emitted when a new composer instance has been created.
void composerWillBeRemoved (QgsComposerView *v)
 This signal is emitted before a new composer instance is going to be removed.
void currentLayerChanged (QgsMapLayer *layer)
 Emitted whenever current (selected) layer changes.
void initializationCompleted ()
 This signal is emitted when the initialization is complete.
void newProjectCreated ()
 emitted when starting an entirely new project
void projectRead ()
 emitted when a project file is successfully read

Public Member Functions

 QgisInterface ()
 Constructor.
virtual ~QgisInterface ()
 Virtual destructor.
virtual QgsLegendInterfacelegendInterface ()=0
 Get pointer to legend interface.

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


Constructor & Destructor Documentation

Constructor.

Definition at line 21 of file qgisinterface.cpp.

Virtual destructor.

Definition at line 27 of file qgisinterface.cpp.


Member Function Documentation

virtual QAction* QgisInterface::actionAbout ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionAddAllToOverview ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionAddFeature ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionAddOgrLayer ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionAddPart ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionAddPgLayer ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionAddRasterLayer ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionAddRing ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionAddToOverview ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionAddWmsLayer ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionAllEdits ( ) [pure virtual, slot]
Note:
added in 1.9
virtual QAction* QgisInterface::actionCancelAllEdits ( ) [pure virtual, slot]
Note:
added in 1.9
virtual QAction* QgisInterface::actionCancelEdits ( ) [pure virtual, slot]
Note:
added in 1.9
virtual QAction* QgisInterface::actionCheckQgisVersion ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionCopyFeatures ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionCopyLayerStyle ( ) [pure virtual, slot]
Note:
added in 1.9
virtual QAction* QgisInterface::actionCustomProjection ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionCutFeatures ( ) [pure virtual, slot]

Edit menu actions.

virtual QAction* QgisInterface::actionDeletePart ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionDeleteRing ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionDeleteSelected ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionDraw ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionDuplicateLayer ( ) [pure virtual, slot]
Note:
added in 1.9
virtual QAction* QgisInterface::actionExit ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionHelpContents ( ) [pure virtual, slot]

Help menu actions.

virtual QAction* QgisInterface::actionHideAllLayers ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionIdentify ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionLayerProperties ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionLayerSaveAs ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionLayerSelectionSaveAs ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionManagePlugins ( ) [pure virtual, slot]

Plugin menu actions.

virtual QAction* QgisInterface::actionMapTips ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionMeasure ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionMeasureArea ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionMoveFeature ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionNewBookmark ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionNewProject ( ) [pure virtual, slot]

File menu actions.

virtual QAction* QgisInterface::actionNewVectorLayer ( ) [pure virtual, slot]

Layer menu actions.

virtual QAction* QgisInterface::actionNodeTool ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionOpenFieldCalculator ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionOpenProject ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionOpenTable ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionOptions ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionPan ( ) [pure virtual, slot]

View menu actions.

virtual QAction* QgisInterface::actionPanToSelected ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionPasteFeatures ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionPasteLayerStyle ( ) [pure virtual, slot]
Note:
added in 1.9
virtual QAction* QgisInterface::actionPluginListSeparator ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionPrintComposer ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionProjectProperties ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionQgisHomePage ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionRemoveAllFromOverview ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionRemoveLayer ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionRollbackAllEdits ( ) [pure virtual, slot]
Note:
added in 1.9
virtual QAction* QgisInterface::actionRollbackEdits ( ) [pure virtual, slot]
Note:
added in 1.9
virtual QAction* QgisInterface::actionSaveActiveLayerEdits ( ) [pure virtual, slot]
Note:
added in 1.9
virtual QAction* QgisInterface::actionSaveAllEdits ( ) [pure virtual, slot]
Note:
added in 1.9
virtual QAction* QgisInterface::actionSaveEdits ( ) [pure virtual, slot]
Note:
added in 1.9
virtual QAction* QgisInterface::actionSaveMapAsImage ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionSaveProject ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionSaveProjectAs ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionSelect ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionSelectFreehand ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionSelectPolygon ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionSelectRadius ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionSelectRectangle ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionShowAllLayers ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionShowBookmarks ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionShowComposerManager ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionShowPythonDialog ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionSimplifyFeature ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionSplitFeatures ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionToggleEditing ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionToggleFullScreen ( ) [pure virtual, slot]

Settings menu actions.

virtual QAction* QgisInterface::actionTouch ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionZoomActualSize ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionZoomFullExtent ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionZoomIn ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionZoomLast ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionZoomOut ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionZoomToLayer ( ) [pure virtual, slot]
virtual QAction* QgisInterface::actionZoomToSelected ( ) [pure virtual, slot]
virtual QList<QgsComposerView*> QgisInterface::activeComposers ( ) [pure virtual, slot]

Return mainwindows / composer views of running composer instances (currently only one)

virtual QgsMapLayer* QgisInterface::activeLayer ( ) [pure virtual, slot]

Get pointer to the active layer (layer selected in the legend)

virtual int QgisInterface::addDatabaseToolBarIcon ( QAction *  qAction) [pure virtual, slot]

Add an icon to the Database toolbar.

Note:
added in 2.0
virtual QAction* QgisInterface::addDatabaseToolBarWidget ( QWidget *  widget) [pure virtual, slot]

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
virtual void QgisInterface::addDockWidget ( Qt::DockWidgetArea  area,
QDockWidget *  dockwidget 
) [pure virtual, slot]

Add a dock widget to the main window.

virtual void QgisInterface::addPluginToDatabaseMenu ( QString  name,
QAction *  action 
) [pure virtual, slot]

Add action to the Database menu.

Note:
added in 1.7
virtual void QgisInterface::addPluginToMenu ( QString  name,
QAction *  action 
) [pure virtual, slot]

Add action to the plugins menu.

virtual void QgisInterface::addPluginToRasterMenu ( QString  name,
QAction *  action 
) [pure virtual, slot]

Add action to the Raster menu.

Note:
added in 2.0
virtual void QgisInterface::addPluginToVectorMenu ( QString  name,
QAction *  action 
) [pure virtual, slot]

Add action to the Vector menu.

Note:
added in 2.0
virtual void QgisInterface::addPluginToWebMenu ( QString  name,
QAction *  action 
) [pure virtual, slot]

Add action to the Web menu.

Note:
added in 2.0
virtual bool QgisInterface::addProject ( QString  theProject) [pure virtual, slot]

Add a project.

virtual QgsRasterLayer* QgisInterface::addRasterLayer ( QString  rasterLayerPath,
QString  baseName = QString() 
) [pure virtual, slot]

Add a raster layer given a raster layer file name.

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

Add a WMS layer.

virtual int QgisInterface::addRasterToolBarIcon ( QAction *  qAction) [pure virtual, slot]

Add an icon to the Raster toolbar.

Note:
added in 2.0
virtual QAction* QgisInterface::addRasterToolBarWidget ( QWidget *  widget) [pure virtual, slot]

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
virtual QToolBar* QgisInterface::addToolBar ( QString  name) [pure virtual, slot]

Add toolbar with specified name.

virtual int QgisInterface::addToolBarIcon ( QAction *  qAction) [pure virtual, slot]

Add an icon to the plugins toolbar.

virtual QAction* QgisInterface::addToolBarWidget ( QWidget *  widget) [pure virtual, slot]

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
virtual QgsVectorLayer* QgisInterface::addVectorLayer ( QString  vectorLayerPath,
QString  baseName,
QString  providerKey 
) [pure virtual, slot]

Add a vector layer.

virtual int QgisInterface::addVectorToolBarIcon ( QAction *  qAction) [pure virtual, slot]

Add an icon to the Vector toolbar.

Note:
added in 2.0
virtual QAction* QgisInterface::addVectorToolBarWidget ( QWidget *  widget) [pure virtual, slot]

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
virtual int QgisInterface::addWebToolBarIcon ( QAction *  qAction) [pure virtual, slot]

Add an icon to the Web toolbar.

Note:
added in 2.0
virtual QAction* QgisInterface::addWebToolBarWidget ( QWidget *  widget) [pure virtual, slot]

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
virtual void QgisInterface::addWindow ( QAction *  action) [pure virtual, slot]

Add window to Window menu.

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

virtual QToolBar* QgisInterface::advancedDigitizeToolBar ( ) [pure virtual, slot]
virtual QToolBar* QgisInterface::attributesToolBar ( ) [pure virtual, slot]
virtual void QgisInterface::buildStyleSheet ( const QMap< QString, QVariant > &  opts) [pure virtual, slot]

Generate stylesheet.

Parameters:
optsgenerated default option values, or a changed copy of them
Note:
added in 1.9

This signal is emitted when a new composer instance has been created.

Note:
added in 1.4

This signal is emitted before a new composer instance is going to be removed.

Note:
added in 1.4
virtual QgsComposerView* QgisInterface::createNewComposer ( QString  title = QString("")) [pure virtual, slot]

Create a new composer.

Parameters:
titlewindow title for new composer (one will be generated if empty)
Returns:
pointer to composer's view
Note:
new composer window will be shown and activated (added in 1.9)
void QgisInterface::currentLayerChanged ( QgsMapLayer layer) [signal]

Emitted whenever current (selected) layer changes.

The pointer to layer can be null if no layer is selected

virtual QMenu* QgisInterface::databaseMenu ( ) [pure virtual, slot]
Note:
added in 1.7
virtual QToolBar* QgisInterface::databaseToolBar ( ) [pure virtual, slot]
Note:
added in 2.0
virtual QFont QgisInterface::defaultStyleSheetFont ( ) [pure virtual, slot]

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

Note:
added in 1.9
virtual QMap<QString, QVariant> QgisInterface::defaultStyleSheetOptions ( ) [pure virtual, slot]

Return changeable options built from settings and/or defaults.

Note:
(added in 1.9)
virtual void QgisInterface::deleteComposer ( QgsComposerView composerView) [pure virtual, slot]

Deletes parent composer of composer view, after closing composer window.

Note:
(added in 1.9)
virtual QToolBar* QgisInterface::digitizeToolBar ( ) [pure virtual, slot]
virtual QgsComposerView* QgisInterface::duplicateComposer ( QgsComposerView composerView,
QString  title = QString("") 
) [pure virtual, slot]

Duplicate an existing parent composer from composer view.

Parameters:
composerViewpointer to existing composer view
titlewindow title for duplicated composer (one will be generated if empty)
Returns:
pointer to duplicate composer's view
Note:
dupicate composer window will be hidden until loaded, then shown and activated (added in 1.9)
virtual QList<QgsMapLayer *> QgisInterface::editableLayers ( bool  modified = false) const [pure virtual, slot]

Return 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
Note:
added in 1.9
virtual QMenu* QgisInterface::editMenu ( ) [pure virtual, slot]
virtual QMenu* QgisInterface::fileMenu ( ) [pure virtual, slot]

Accessors for inserting items into menus and toolbars.

An item can be inserted before any existing action. Menus

virtual QToolBar* QgisInterface::fileToolBar ( ) [pure virtual, slot]

ToolBars.

virtual QMenu* QgisInterface::firstRightStandardMenu ( ) [pure virtual, slot]
virtual QDialog* QgisInterface::getFeatureForm ( QgsVectorLayer l,
QgsFeature f 
) [pure virtual, slot]
virtual QMenu* QgisInterface::helpMenu ( ) [pure virtual, slot]
virtual QToolBar* QgisInterface::helpToolBar ( ) [pure virtual, slot]

This signal is emitted when the initialization is complete.

Note:
added in version 1.6
virtual void QgisInterface::insertAddLayerAction ( QAction *  action) [pure virtual, slot]

Add "add layer" action to layer menu.

Note:
added in 1.7
virtual QMenu* QgisInterface::layerMenu ( ) [pure virtual, slot]
virtual QToolBar* QgisInterface::layerToolBar ( ) [pure virtual, slot]

Get pointer to legend interface.

Note:
added in 1.4
virtual QWidget* QgisInterface::mainWindow ( ) [pure virtual, slot]

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

virtual QgsMapCanvas* QgisInterface::mapCanvas ( ) [pure virtual, slot]

Return a pointer to the map canvas.

virtual QToolBar* QgisInterface::mapNavToolToolBar ( ) [pure virtual, slot]
virtual QgsMessageBar* QgisInterface::messageBar ( ) [pure virtual, slot]

Return the message bar of the main app.

virtual int QgisInterface::messageTimeout ( ) [pure virtual, slot]

Get timeout for timed messages: default of 5 seconds.

Note:
added in 1.9
virtual QMenu* QgisInterface::newLayerMenu ( ) [pure virtual, slot]
Note:
added in 2.0
virtual void QgisInterface::newProject ( bool  thePromptToSaveFlag = false) [pure virtual, slot]

Start a blank project.

emitted when starting an entirely new project

Note:
This is similar to projectRead(); plug-ins 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.

Added in v1.6

virtual bool QgisInterface::openFeatureForm ( QgsVectorLayer l,
QgsFeature f,
bool  updateFeatureOnly = false 
) [pure virtual, slot]

Open feature form.

virtual Q_DECL_DEPRECATED void QgisInterface::openURL ( QString  url,
bool  useQgisDocDirectory = true 
) [pure virtual, slot]

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:
virtual QMenu* QgisInterface::pluginMenu ( ) [pure virtual, slot]
virtual QToolBar* QgisInterface::pluginToolBar ( ) [pure virtual, slot]
virtual void QgisInterface::preloadForm ( QString  uifile) [pure virtual, slot]
void QgisInterface::projectRead ( ) [signal]

emitted when a project file is successfully read

Note:
This is useful for plug-ins that store properties with project files. A plug-in can connect to this signal. When it is emitted, the plug-in knows to then check the project properties for any relevant state.

Added in v1.6

virtual QMenu* QgisInterface::rasterMenu ( ) [pure virtual, slot]
virtual QToolBar* QgisInterface::rasterToolBar ( ) [pure virtual, slot]
Note:
added in 1.7
virtual bool QgisInterface::registerMainWindowAction ( QAction *  action,
QString  defaultShortcut 
) [pure virtual, slot]

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

Note:
added in 1.2
virtual void QgisInterface::removeAddLayerAction ( QAction *  action) [pure virtual, slot]

Remove "add layer" action from layer menu.

Note:
added in 1.7
virtual void QgisInterface::removeDatabaseToolBarIcon ( QAction *  qAction) [pure virtual, slot]

Remove an action (icon) from the Database toolbar.

Note:
added in 2.0
virtual void QgisInterface::removeDockWidget ( QDockWidget *  dockwidget) [pure virtual, slot]

Remove specified dock widget from main window (doesn't delete it).

Note:
Added in 1.1
virtual void QgisInterface::removePluginDatabaseMenu ( QString  name,
QAction *  action 
) [pure virtual, slot]

Remove action from the Database menu.

Note:
added in 1.7
virtual void QgisInterface::removePluginMenu ( QString  name,
QAction *  action 
) [pure virtual, slot]

Remove action from the plugins menu.

virtual void QgisInterface::removePluginRasterMenu ( QString  name,
QAction *  action 
) [pure virtual, slot]

Remove action from the Raster menu.

Note:
added in 2.0
virtual void QgisInterface::removePluginVectorMenu ( QString  name,
QAction *  action 
) [pure virtual, slot]

Remove action from the Vector menu.

Note:
added in 2.0
virtual void QgisInterface::removePluginWebMenu ( QString  name,
QAction *  action 
) [pure virtual, slot]

Remove action from the Web menu.

Note:
added in 2.0
virtual void QgisInterface::removeRasterToolBarIcon ( QAction *  qAction) [pure virtual, slot]

Remove an action (icon) from the Raster toolbar.

Note:
added in 2.0
virtual void QgisInterface::removeToolBarIcon ( QAction *  qAction) [pure virtual, slot]

Remove an action (icon) from the plugin toolbar.

virtual void QgisInterface::removeVectorToolBarIcon ( QAction *  qAction) [pure virtual, slot]

Remove an action (icon) from the Vector toolbar.

Note:
added in 2.0
virtual void QgisInterface::removeWebToolBarIcon ( QAction *  qAction) [pure virtual, slot]

Remove an action (icon) from the Web toolbar.

Note:
added in 2.0
virtual void QgisInterface::removeWindow ( QAction *  action) [pure virtual, slot]

Remove window from Window menu.

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

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

Save changed default option keys/values to user settings.

Note:
added in 1.9
virtual bool QgisInterface::setActiveLayer ( QgsMapLayer ) [pure virtual, slot]

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

virtual QMenu* QgisInterface::settingsMenu ( ) [pure virtual, slot]
virtual void QgisInterface::showAttributeTable ( QgsVectorLayer l) [pure virtual, slot]

open attribute table dialog

Note:
added in 1.7
virtual void QgisInterface::showLayerProperties ( QgsMapLayer l) [pure virtual, slot]

open layer properties dialog

Note:
added in 1.5
virtual bool QgisInterface::unregisterMainWindowAction ( QAction *  action) [pure virtual, slot]

Unregister a previously registered action.

(e.g. when plugin is going to be unloaded)

Note:
added in 1.2
virtual QMenu* QgisInterface::vectorMenu ( ) [pure virtual, slot]
Note:
added in 2.0
virtual QToolBar* QgisInterface::vectorToolBar ( ) [pure virtual, slot]
Note:
added in 2.0
virtual QMenu* QgisInterface::viewMenu ( ) [pure virtual, slot]
virtual QMenu* QgisInterface::webMenu ( ) [pure virtual, slot]
Note:
added in 2.0
virtual QToolBar* QgisInterface::webToolBar ( ) [pure virtual, slot]
Note:
added in 2.0
virtual QMenu* QgisInterface::windowMenu ( ) [pure virtual, slot]
virtual void QgisInterface::zoomFull ( ) [pure virtual, slot]

Zoom to full extent of map layers.

virtual void QgisInterface::zoomToActiveLayer ( ) [pure virtual, slot]

Zoom to extent of the active layer.

virtual void QgisInterface::zoomToNext ( ) [pure virtual, slot]

Zoom to next view extent.

virtual void QgisInterface::zoomToPrevious ( ) [pure virtual, slot]

Zoom to previous view extent.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines