Fix casting

This commit is contained in:
Nyall Dawson 2022-04-07 14:48:38 +10:00
parent a999b95f10
commit 06087eebee
2 changed files with 8 additions and 2 deletions

View File

@ -14,7 +14,8 @@
%ModuleHeaderCode
#include "qgsplottool.h"
#include "qgsplotpantool.h"
#include "qgsplottoolpan.h"
#include "qgsplottoolzoom.h"
%End
@ -34,6 +35,8 @@ Plot tools are user tools for manipulating and interacting with a :py:class:`Qgs
%ConvertToSubClassCode
if ( qobject_cast<QgsPlotToolPan *>( sipCpp ) != nullptr )
sipType = sipType_QgsPlotToolPan;
else if ( qobject_cast<QgsPlotToolZoom *>( sipCpp ) != nullptr )
sipType = sipType_QgsPlotToolZoom;
else if ( qobject_cast<QgsPlotTool *>( sipCpp ) != nullptr )
sipType = sipType_QgsPlotTool;
else

View File

@ -41,7 +41,8 @@ class QAction;
#ifdef SIP_RUN
% ModuleHeaderCode
#include "qgsplottool.h"
#include "qgsplotpantool.h"
#include "qgsplottoolpan.h"
#include "qgsplottoolzoom.h"
% End
#endif
@ -60,6 +61,8 @@ class GUI_EXPORT QgsPlotTool : public QObject
SIP_CONVERT_TO_SUBCLASS_CODE
if ( qobject_cast<QgsPlotToolPan *>( sipCpp ) != nullptr )
sipType = sipType_QgsPlotToolPan;
else if ( qobject_cast<QgsPlotToolZoom *>( sipCpp ) != nullptr )
sipType = sipType_QgsPlotToolZoom;
else if ( qobject_cast<QgsPlotTool *>( sipCpp ) != nullptr )
sipType = sipType_QgsPlotTool;
else