Add missing sip cast

This commit is contained in:
Nyall Dawson 2025-08-18 13:58:13 +10:00
parent c549f43bf9
commit 6c63043138
3 changed files with 21 additions and 0 deletions

View File

@ -22,6 +22,12 @@ layers and text filtering.
%TypeHeaderCode
#include "qgslayertreeview.h"
%End
%ConvertToSubClassCode
if ( qobject_cast<QgsLayerTreeProxyModel *>( sipCpp ) != nullptr )
sipType = sipType_QgsLayerTreeProxyModel;
else
sipType = nullptr;
%End
public:
QgsLayerTreeProxyModel( QgsLayerTreeModel *treeModel, QObject *parent );

View File

@ -22,6 +22,12 @@ layers and text filtering.
%TypeHeaderCode
#include "qgslayertreeview.h"
%End
%ConvertToSubClassCode
if ( qobject_cast<QgsLayerTreeProxyModel *>( sipCpp ) != nullptr )
sipType = sipType_QgsLayerTreeProxyModel;
else
sipType = nullptr;
%End
public:
QgsLayerTreeProxyModel( QgsLayerTreeModel *treeModel, QObject *parent );

View File

@ -45,6 +45,15 @@ class QgsLayerTreeFilterProxyModel;
*/
class GUI_EXPORT QgsLayerTreeProxyModel : public QSortFilterProxyModel
{
#ifdef SIP_RUN
SIP_CONVERT_TO_SUBCLASS_CODE
if ( qobject_cast<QgsLayerTreeProxyModel *>( sipCpp ) != nullptr )
sipType = sipType_QgsLayerTreeProxyModel;
else
sipType = nullptr;
SIP_END
#endif
Q_OBJECT
public: