From 8795bd9da5defa3a96cd381685104af3d29463eb Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Sun, 23 Apr 2023 11:02:29 +1000 Subject: [PATCH] History providers should be QObjects --- python/gui/auto_generated/history/qgshistoryprovider.sip.in | 4 ++-- src/gui/history/qgshistoryprovider.h | 6 ++++-- src/gui/processing/qgsprocessinghistoryprovider.h | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/python/gui/auto_generated/history/qgshistoryprovider.sip.in b/python/gui/auto_generated/history/qgshistoryprovider.sip.in index b74b615dddb..4c27b675922 100644 --- a/python/gui/auto_generated/history/qgshistoryprovider.sip.in +++ b/python/gui/auto_generated/history/qgshistoryprovider.sip.in @@ -8,7 +8,7 @@ -class QgsAbstractHistoryProvider +class QgsAbstractHistoryProvider : QObject { %Docstring(signature="appended") Abstract base class for objects which track user history (i.e. operations performed through the GUI). @@ -24,7 +24,7 @@ Abstract base class for objects which track user history (i.e. operations perfor public: %ConvertToSubClassCode - if ( dynamic_cast( sipCpp ) ) + if ( qobject_cast( sipCpp ) ) sipType = sipType_QgsProcessingHistoryProvider; else sipType = nullptr; diff --git a/src/gui/history/qgshistoryprovider.h b/src/gui/history/qgshistoryprovider.h index 5d59031c4f2..1e05d5ebef2 100644 --- a/src/gui/history/qgshistoryprovider.h +++ b/src/gui/history/qgshistoryprovider.h @@ -33,13 +33,15 @@ class QgsHistoryWidgetContext; * \ingroup gui * \since QGIS 3.24 */ -class GUI_EXPORT QgsAbstractHistoryProvider +class GUI_EXPORT QgsAbstractHistoryProvider : public QObject { + Q_OBJECT + public: #ifdef SIP_RUN SIP_CONVERT_TO_SUBCLASS_CODE - if ( dynamic_cast( sipCpp ) ) + if ( qobject_cast( sipCpp ) ) sipType = sipType_QgsProcessingHistoryProvider; else sipType = nullptr; diff --git a/src/gui/processing/qgsprocessinghistoryprovider.h b/src/gui/processing/qgsprocessinghistoryprovider.h index f67d254d468..d430bd79686 100644 --- a/src/gui/processing/qgsprocessinghistoryprovider.h +++ b/src/gui/processing/qgsprocessinghistoryprovider.h @@ -29,6 +29,8 @@ */ class GUI_EXPORT QgsProcessingHistoryProvider : public QgsAbstractHistoryProvider { + Q_OBJECT + public: QgsProcessingHistoryProvider();