PyQGIS fix: QgsMapLayer has QObject as subclass

(it wasn't possible to connect to its signals)


git-svn-id: http://svn.osgeo.org/qgis/trunk@9637 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
wonder 2008-11-14 23:42:08 +00:00
parent 19bc6b9bd8
commit e15424a23e

View File

@ -3,21 +3,25 @@
* \brief Base class for all map layer types.
* This class is the base class for all map layer types (vector, raster).
*/
class QgsMapLayer // TODO: problem when derived from QObject
class QgsMapLayer : QObject
{
%TypeHeaderCode
#include <qgsmaplayer.h>
%End
%ConvertToSubClassCode
if (sipCpp->type() == QgsMapLayer::VectorLayer)
if (sipCpp->inherits("QgsMapLayer"))
{
sipClass = sipClass_QgsVectorLayer;
}
else if (sipCpp->type() == QgsMapLayer::RasterLayer)
{
sipClass = sipClass_QgsRasterLayer;
sipClass = sipClass_QgsMapLayer;
QgsMapLayer* layer = qobject_cast<QgsMapLayer*>(sipCpp);
if (layer->type() == QgsMapLayer::VectorLayer)
{
sipClass = sipClass_QgsVectorLayer;
}
else if (layer->type() == QgsMapLayer::RasterLayer)
{
sipClass = sipClass_QgsRasterLayer;
}
}
else
{