Skip to content

Commit

Permalink
use TransferBack
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids authored and nyalldawson committed Oct 25, 2024
1 parent 97f8217 commit 1f0a5d5
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Adds an editor widget ``wrapper`` for a specific setting to the registry
Returns a new instance of the editor widget for the given ``id``
%End

QWidget *createEditor( const QgsSettingsEntryBase *setting, const QStringList &dynamicKeyPartList, QWidget *parent = 0 ) const /KeepReference/;
QWidget *createEditor( const QgsSettingsEntryBase *setting, const QStringList &dynamicKeyPartList, QWidget *parent = 0 ) const /TransferBack/;
%Docstring
Creates an editor widget for the given ``setting`` using the corresponding registered wrapper
%End
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ This id of the type of settings it handles
Creates a new instance of the editor wrapper so it can be configured for a widget and a setting
%End

QWidget *createEditor( const QgsSettingsEntryBase *setting, const QStringList &dynamicKeyPartList = QStringList(), QWidget *parent = 0 ) /KeepReference/;
QWidget *createEditor( const QgsSettingsEntryBase *setting, const QStringList &dynamicKeyPartList = QStringList(), QWidget *parent = 0 ) /TransferBack/;
%Docstring
Creates the editor widget for the given ``setting``
%End
Expand Down Expand Up @@ -106,7 +106,7 @@ Returns the dynamic key parts


protected:
virtual QWidget *createEditorPrivate( QWidget *parent = 0 ) const = 0 /KeepReference,Factory/;
virtual QWidget *createEditorPrivate( QWidget *parent = 0 ) const = 0 /TransferBack/;
%Docstring
Creates the widgets
%End
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Adds an editor widget ``wrapper`` for a specific setting to the registry
Returns a new instance of the editor widget for the given ``id``
%End

QWidget *createEditor( const QgsSettingsEntryBase *setting, const QStringList &dynamicKeyPartList, QWidget *parent = 0 ) const /KeepReference/;
QWidget *createEditor( const QgsSettingsEntryBase *setting, const QStringList &dynamicKeyPartList, QWidget *parent = 0 ) const /TransferBack/;
%Docstring
Creates an editor widget for the given ``setting`` using the corresponding registered wrapper
%End
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ This id of the type of settings it handles
Creates a new instance of the editor wrapper so it can be configured for a widget and a setting
%End

QWidget *createEditor( const QgsSettingsEntryBase *setting, const QStringList &dynamicKeyPartList = QStringList(), QWidget *parent = 0 ) /KeepReference/;
QWidget *createEditor( const QgsSettingsEntryBase *setting, const QStringList &dynamicKeyPartList = QStringList(), QWidget *parent = 0 ) /TransferBack/;
%Docstring
Creates the editor widget for the given ``setting``
%End
Expand Down Expand Up @@ -106,7 +106,7 @@ Returns the dynamic key parts


protected:
virtual QWidget *createEditorPrivate( QWidget *parent = 0 ) const = 0 /KeepReference,Factory/;
virtual QWidget *createEditorPrivate( QWidget *parent = 0 ) const = 0 /TransferBack/;
%Docstring
Creates the widgets
%End
Expand Down
2 changes: 1 addition & 1 deletion src/gui/settings/qgssettingseditorwidgetregistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class GUI_EXPORT QgsSettingsEditorWidgetRegistry
QgsSettingsEditorWidgetWrapper *createWrapper( const QString &id, QObject *parent ) const SIP_FACTORY;

//! Creates an editor widget for the given \a setting using the corresponding registered wrapper
QWidget *createEditor( const QgsSettingsEntryBase *setting, const QStringList &dynamicKeyPartList, QWidget *parent = nullptr ) const SIP_KEEPREFERENCE;
QWidget *createEditor( const QgsSettingsEntryBase *setting, const QStringList &dynamicKeyPartList, QWidget *parent = nullptr ) const SIP_TRANSFERBACK;

private:
QMap<QString, QgsSettingsEditorWidgetWrapper *> mWrappers;
Expand Down
4 changes: 2 additions & 2 deletions src/gui/settings/qgssettingseditorwidgetwrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class GUI_EXPORT QgsSettingsEditorWidgetWrapper : public QObject
virtual QgsSettingsEditorWidgetWrapper *createWrapper( QObject *parent = nullptr ) const = 0 SIP_FACTORY;

//! Creates the editor widget for the given \a setting
QWidget *createEditor( const QgsSettingsEntryBase *setting, const QStringList &dynamicKeyPartList = QStringList(), QWidget *parent = nullptr ) SIP_KEEPREFERENCE;
QWidget *createEditor( const QgsSettingsEntryBase *setting, const QStringList &dynamicKeyPartList = QStringList(), QWidget *parent = nullptr ) SIP_TRANSFERBACK;

//! Configures the \a editor according the setting
bool configureEditor( QWidget *editor, const QgsSettingsEntryBase *setting, const QStringList &dynamicKeyPartList = QStringList() );
Expand Down Expand Up @@ -103,7 +103,7 @@ class GUI_EXPORT QgsSettingsEditorWidgetWrapper : public QObject

protected:
//! Creates the widgets
virtual QWidget *createEditorPrivate( QWidget *parent = nullptr ) const = 0 SIP_KEEPREFERENCE SIP_FACTORY;
virtual QWidget *createEditorPrivate( QWidget *parent = nullptr ) const = 0 SIP_TRANSFERBACK;

//! Configures an existing \a editor widget
virtual bool configureEditorPrivate( QWidget *editor SIP_TRANSFERBACK, const QgsSettingsEntryBase *setting SIP_KEEPREFERENCE ) = 0;
Expand Down

0 comments on commit 1f0a5d5

Please sign in to comment.