mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
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:
parent
19bc6b9bd8
commit
e15424a23e
@ -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
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user