The interface class now allows QgisApp access via app().

This was necessary to allow plug-ins to connect() to various QgisApp slots and
signals.  Since this somewhat short-circuits the need for the QgisInterface
classes, this might indicate the need for design refactoring.


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@2267 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
mcoletti 2004-11-17 16:27:02 +00:00
parent d8c9b8b997
commit 79aba2e52d
2 changed files with 22 additions and 0 deletions

View File

@ -133,3 +133,10 @@ QgsMapLayerRegistry * QgisIface::getLayerRegistry()
{
return qgis->getLayerRegistry();
}
QgisApp *
QgisIface::app()
{
return qgis;
} // QgisIface::app()

View File

@ -85,6 +85,21 @@ class QgisIface : public QgisInterface{
QgsMapCanvas * getMapCanvas();
/** Return a pointer to the map layer registry */
QgsMapLayerRegistry * getLayerRegistry();
/** Gives access to main QgisApp object
Even though this class is supposed to act as a Facade for the
QgisApp, the plug-ins need direct access to the application object
for their connect() calls.
@todo XXX this may call into question the current need for this
interface? Maybe these connect() calls can be done in some other
less intrusive way?
*/
QgisApp * app();
private:
/// QgisIface aren't copied