History providers should be QObjects

This commit is contained in:
Nyall Dawson 2023-04-23 11:02:29 +10:00
parent 8958af74da
commit 8795bd9da5
3 changed files with 8 additions and 4 deletions

View File

@ -8,7 +8,7 @@
class QgsAbstractHistoryProvider class QgsAbstractHistoryProvider : QObject
{ {
%Docstring(signature="appended") %Docstring(signature="appended")
Abstract base class for objects which track user history (i.e. operations performed through the GUI). 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: public:
%ConvertToSubClassCode %ConvertToSubClassCode
if ( dynamic_cast<QgsProcessingHistoryProvider *>( sipCpp ) ) if ( qobject_cast<QgsProcessingHistoryProvider *>( sipCpp ) )
sipType = sipType_QgsProcessingHistoryProvider; sipType = sipType_QgsProcessingHistoryProvider;
else else
sipType = nullptr; sipType = nullptr;

View File

@ -33,13 +33,15 @@ class QgsHistoryWidgetContext;
* \ingroup gui * \ingroup gui
* \since QGIS 3.24 * \since QGIS 3.24
*/ */
class GUI_EXPORT QgsAbstractHistoryProvider class GUI_EXPORT QgsAbstractHistoryProvider : public QObject
{ {
Q_OBJECT
public: public:
#ifdef SIP_RUN #ifdef SIP_RUN
SIP_CONVERT_TO_SUBCLASS_CODE SIP_CONVERT_TO_SUBCLASS_CODE
if ( dynamic_cast<QgsProcessingHistoryProvider *>( sipCpp ) ) if ( qobject_cast<QgsProcessingHistoryProvider *>( sipCpp ) )
sipType = sipType_QgsProcessingHistoryProvider; sipType = sipType_QgsProcessingHistoryProvider;
else else
sipType = nullptr; sipType = nullptr;

View File

@ -29,6 +29,8 @@
*/ */
class GUI_EXPORT QgsProcessingHistoryProvider : public QgsAbstractHistoryProvider class GUI_EXPORT QgsProcessingHistoryProvider : public QgsAbstractHistoryProvider
{ {
Q_OBJECT
public: public:
QgsProcessingHistoryProvider(); QgsProcessingHistoryProvider();