Skip to content

Commit

Permalink
Add missing cast code
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 13, 2020
1 parent ee2b94f commit e071d2d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 2 deletions.
Expand Up @@ -10,7 +10,6 @@




class QgsDataProviderTemporalCapabilities
{
%Docstring
Expand All @@ -21,6 +20,16 @@ Base class for handling properties relating to a data provider's temporal capabi

%TypeHeaderCode
#include "qgsdataprovidertemporalcapabilities.h"
%End
%ConvertToSubClassCode
if ( dynamic_cast<QgsRasterDataProviderTemporalCapabilities *>( sipCpp ) )
{
sipType = sipType_QgsRasterDataProviderTemporalCapabilities;
}
else
{
sipType = 0;
}
%End
public:

Expand Down
10 changes: 10 additions & 0 deletions python/core/auto_generated/qgsmaplayertemporalproperties.sip.in
Expand Up @@ -25,6 +25,16 @@ how an individual QgsMapLayer behaves in a temporal context, e.g. while animatin

%TypeHeaderCode
#include "qgsmaplayertemporalproperties.h"
%End
%ConvertToSubClassCode
if ( qobject_cast<QgsRasterLayerTemporalProperties *>( sipCpp ) )
{
sipType = sipType_QgsRasterLayerTemporalProperties;
}
else
{
sipType = 0;
}
%End
public:

Expand Down
15 changes: 14 additions & 1 deletion src/core/qgsdataprovidertemporalcapabilities.h
Expand Up @@ -30,9 +30,22 @@
*
* \since QGIS 3.14
*/

class CORE_EXPORT QgsDataProviderTemporalCapabilities
{

#ifdef SIP_RUN
SIP_CONVERT_TO_SUBCLASS_CODE
if ( dynamic_cast<QgsRasterDataProviderTemporalCapabilities *>( sipCpp ) )
{
sipType = sipType_QgsRasterDataProviderTemporalCapabilities;
}
else
{
sipType = 0;
}
SIP_END
#endif

public:

/**
Expand Down
13 changes: 13 additions & 0 deletions src/core/qgsmaplayertemporalproperties.h
Expand Up @@ -43,6 +43,19 @@ class CORE_EXPORT QgsMapLayerTemporalProperties : public QgsTemporalProperty
{
Q_OBJECT

#ifdef SIP_RUN
SIP_CONVERT_TO_SUBCLASS_CODE
if ( qobject_cast<QgsRasterLayerTemporalProperties *>( sipCpp ) )
{
sipType = sipType_QgsRasterLayerTemporalProperties;
}
else
{
sipType = 0;
}
SIP_END
#endif

public:

/**
Expand Down

0 comments on commit e071d2d

Please sign in to comment.