mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-08 00:05:09 -04:00
fix dox
This commit is contained in:
parent
de1363df05
commit
7498d0994c
@ -347,13 +347,11 @@ class QgsSettingsEntryBaseTemplate : QgsSettingsEntryBase
|
||||
{
|
||||
%Docstring(signature="appended")
|
||||
|
||||
Base abstract class for settings entry which are passed by reference
|
||||
Base abstract class for settings entries with typed get and set methods
|
||||
|
||||
.. seealso:: :py:class:`QgsSettingsEntryBase`
|
||||
|
||||
.. seealso:: :py:class:`QgsSettingsEntryByValue`
|
||||
|
||||
.. versionadded:: 3.26
|
||||
.. versionadded:: 3.32
|
||||
%End
|
||||
|
||||
%TypeHeaderCode
|
||||
|
@ -85,8 +85,14 @@ The wrapper must be configured before calling this medthod
|
||||
|
||||
protected:
|
||||
virtual QWidget *createEditorPrivate( QWidget *parent = 0 ) const = 0;
|
||||
%Docstring
|
||||
Creates the widgets
|
||||
%End
|
||||
|
||||
virtual bool configureEditorPrivate( QWidget *editor, const QgsSettingsEntryBase *setting ) = 0;
|
||||
%Docstring
|
||||
Configures an existing widget
|
||||
%End
|
||||
|
||||
};
|
||||
|
||||
|
@ -27,6 +27,9 @@ This class is a base factory of editor for settings
|
||||
%End
|
||||
public:
|
||||
QgsSettingsEditorWidgetWrapperTemplate( QObject *parent = 0 );
|
||||
%Docstring
|
||||
Constructor
|
||||
%End
|
||||
virtual QString id() const = 0;
|
||||
|
||||
virtual bool setWidgetFromSetting() const;
|
||||
@ -36,10 +39,16 @@ This class is a base factory of editor for settings
|
||||
virtual void setWidgetFromVariant( const QVariant &value ) const;
|
||||
|
||||
virtual bool setWidgetValue( const U &value ) const = 0;
|
||||
%Docstring
|
||||
Sets the widget value
|
||||
%End
|
||||
|
||||
virtual QVariant variantValueFromWidget() const;
|
||||
|
||||
virtual U valueFromWidget() const = 0;
|
||||
%Docstring
|
||||
Returns the widget value
|
||||
%End
|
||||
|
||||
V *editor() const;
|
||||
%Docstring
|
||||
@ -83,6 +92,9 @@ typedef QgsSettingsEditorWidgetWrapperTemplate<QgsSettingsEntryString,QLineEdit,
|
||||
%End
|
||||
public:
|
||||
QgsSettingsStringEditorWidgetWrapper( QObject *parent = 0 );
|
||||
%Docstring
|
||||
Constructor
|
||||
%End
|
||||
|
||||
virtual QgsSettingsEditorWidgetWrapper *createWrapper( QObject *parent = 0 ) const;
|
||||
|
||||
@ -116,6 +128,9 @@ typedef QgsSettingsEditorWidgetWrapperTemplate<QgsSettingsEntryBool,QCheckBox,bo
|
||||
%End
|
||||
public:
|
||||
QgsSettingsBoolEditorWidgetWrapper( QObject *parent = 0 );
|
||||
%Docstring
|
||||
Constructor
|
||||
%End
|
||||
|
||||
virtual QgsSettingsEditorWidgetWrapper *createWrapper( QObject *parent = 0 ) const;
|
||||
|
||||
@ -149,6 +164,9 @@ typedef QgsSettingsEditorWidgetWrapperTemplate<QgsSettingsEntryInteger,QSpinBox,
|
||||
%End
|
||||
public:
|
||||
QgsSettingsIntegerEditorWidgetWrapper( QObject *parent = 0 );
|
||||
%Docstring
|
||||
Constructor
|
||||
%End
|
||||
|
||||
virtual QgsSettingsEditorWidgetWrapper *createWrapper( QObject *parent = 0 ) const;
|
||||
|
||||
@ -183,6 +201,9 @@ typedef QgsSettingsEditorWidgetWrapperTemplate<QgsSettingsEntryDouble,QDoubleSpi
|
||||
%End
|
||||
public:
|
||||
QgsSettingsDoubleEditorWidgetWrapper( QObject *parent = 0 );
|
||||
%Docstring
|
||||
Constructor
|
||||
%End
|
||||
|
||||
virtual QgsSettingsEditorWidgetWrapper *createWrapper( QObject *parent = 0 ) const;
|
||||
|
||||
@ -217,6 +238,9 @@ typedef QgsSettingsEditorWidgetWrapperTemplate<QgsSettingsEntryColor,QgsColorBut
|
||||
%End
|
||||
public:
|
||||
QgsSettingsColorEditorWidgetWrapper( QObject *parent = 0 );
|
||||
%Docstring
|
||||
Constructor
|
||||
%End
|
||||
|
||||
virtual QgsSettingsEditorWidgetWrapper *createWrapper( QObject *parent = 0 ) const;
|
||||
|
||||
|
@ -41,6 +41,9 @@ Constructor
|
||||
~QgsSettingsTreeModel();
|
||||
|
||||
void applyChanges();
|
||||
%Docstring
|
||||
Apply pending changes in the model to the corresponding settings
|
||||
%End
|
||||
|
||||
|
||||
|
||||
|
@ -30,6 +30,9 @@ Constructor
|
||||
|
||||
|
||||
void applyChanges() const;
|
||||
%Docstring
|
||||
Apply changes to settings value
|
||||
%End
|
||||
|
||||
};
|
||||
|
||||
|
@ -57,8 +57,8 @@ QgsAdvancedSettingsWidget::~QgsAdvancedSettingsWidget()
|
||||
|
||||
void QgsAdvancedSettingsWidget::apply()
|
||||
{
|
||||
// mAdvancedSettingsEditor applies changes immediately
|
||||
// new settings tree is performing changes on appy
|
||||
// the old settings editor applies changes immediately
|
||||
// new settings tree is performing changes on apply
|
||||
if ( mTreeWidget )
|
||||
mTreeWidget->applyChanges();
|
||||
|
||||
|
@ -353,13 +353,12 @@ class CORE_EXPORT QgsSettingsEntryBase
|
||||
|
||||
/**
|
||||
* \ingroup core
|
||||
* \class QgsSettingsEntryByReference
|
||||
* \class QgsSettingsEntryBaseTemplate
|
||||
*
|
||||
* \brief Base abstract class for settings entry which are passed by reference
|
||||
* \brief Base abstract class for settings entries with typed get and set methods
|
||||
* \see QgsSettingsEntryBase
|
||||
* \see QgsSettingsEntryByValue
|
||||
*
|
||||
* \since QGIS 3.26
|
||||
* \since QGIS 3.32
|
||||
*/
|
||||
template<class T>
|
||||
class QgsSettingsEntryBaseTemplate : public QgsSettingsEntryBase
|
||||
|
@ -1,5 +1,5 @@
|
||||
/***************************************************************************
|
||||
qgssettingsfactoryfactoryregistry.cpp
|
||||
qgssettingseditorwidgetregistry.cpp
|
||||
---------------------
|
||||
begin : April 2023
|
||||
copyright : (C) 2023 by Denis Rouzaud
|
||||
@ -66,7 +66,3 @@ QWidget *QgsSettingsEditorWidgetRegistry::createEditor( const QgsSettingsEntryBa
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -28,7 +28,7 @@ class QgsSettingsEditorWidgetWrapper;
|
||||
|
||||
/**
|
||||
* \ingroup gui
|
||||
* \brief This class manages editors for settings
|
||||
* \brief This class manages editor widgets for settings
|
||||
*
|
||||
* \since QGIS 3.32
|
||||
*/
|
||||
@ -40,15 +40,15 @@ class GUI_EXPORT QgsSettingsEditorWidgetRegistry
|
||||
~QgsSettingsEditorWidgetRegistry();
|
||||
|
||||
/**
|
||||
* Adds a editor to the registry
|
||||
* Returns FALSE if a editor with same id already exists.
|
||||
* Adds an editor widget \a wrapper to the registry
|
||||
* Returns FALSE if an editor widget with same id already exists.
|
||||
*/
|
||||
bool addWrapper( QgsSettingsEditorWidgetWrapper *wrapper SIP_TRANSFER );
|
||||
|
||||
//! Returns a new instance of the editor for the given id
|
||||
//! Returns a new instance of the editor widget for the given \a id
|
||||
QgsSettingsEditorWidgetWrapper *createWrapper( const QString &id, QObject *parent ) const;
|
||||
|
||||
//! Creates the editor for the given settings using the corresponding registered wrapper
|
||||
//! 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_FACTORY;
|
||||
|
||||
//! Returns a map <name, id> of all registered editors.
|
||||
|
@ -44,7 +44,7 @@ QWidget *QgsSettingsEditorWidgetWrapper::createEditor( const QgsSettingsEntryBas
|
||||
if ( configureEditor( editor, setting, dynamicKeyPartList ) )
|
||||
return editor;
|
||||
else
|
||||
QgsDebugMsg( QStringLiteral( "editor could not be confiugured" ) );
|
||||
QgsDebugMsg( QStringLiteral( "editor could not be configured" ) );
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ class GUI_EXPORT QgsSettingsEditorWidgetWrapper : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
//! Creates a wrapper from the definition stored in a widget created by createEditor()
|
||||
//! Creates a wrapper from the definition stored in a \a widget created by createEditor()
|
||||
static QgsSettingsEditorWidgetWrapper *fromWidget( const QWidget *widget ) SIP_FACTORY;
|
||||
|
||||
//! Constructor
|
||||
@ -50,7 +50,7 @@ class GUI_EXPORT QgsSettingsEditorWidgetWrapper : public QObject
|
||||
//! Creates a new instance of the editor wrapper so it can be configured for a widget and a setting
|
||||
virtual QgsSettingsEditorWidgetWrapper *createWrapper( QObject *parent = nullptr ) const = 0;
|
||||
|
||||
//! Creates the editor for the given widget
|
||||
//! Creates the editor widget for the given \a setting
|
||||
QWidget *createEditor( const QgsSettingsEntryBase *setting, const QStringList &dynamicKeyPartList = QStringList(), QWidget *parent = nullptr );
|
||||
|
||||
//! Configures the \a editor according the setting
|
||||
@ -63,7 +63,7 @@ class GUI_EXPORT QgsSettingsEditorWidgetWrapper : public QObject
|
||||
virtual bool setWidgetFromSetting() const = 0;
|
||||
|
||||
/**
|
||||
* SDets the setting value from the widget value
|
||||
* Sets the setting value from the widget value
|
||||
* The wrapper must be configured before calling this medthod
|
||||
*/
|
||||
virtual bool setSettingFromWidget() const = 0;
|
||||
@ -75,15 +75,17 @@ class GUI_EXPORT QgsSettingsEditorWidgetWrapper : public QObject
|
||||
virtual QVariant variantValueFromWidget() const = 0;
|
||||
|
||||
/**
|
||||
* Sets the value of the widget
|
||||
* Sets the \a value of the widget
|
||||
* The wrapper must be configured before calling this medthod
|
||||
*/
|
||||
virtual void setWidgetFromVariant( const QVariant &value ) const = 0;
|
||||
|
||||
|
||||
protected:
|
||||
//! Creates the widgets
|
||||
virtual QWidget *createEditorPrivate( QWidget *parent = nullptr ) const = 0;
|
||||
|
||||
//! Configures an existing \a editor widget
|
||||
virtual bool configureEditorPrivate( QWidget *editor, const QgsSettingsEntryBase *setting ) = 0;
|
||||
|
||||
QStringList mDynamicKeyPartList;
|
||||
|
@ -45,6 +45,7 @@ template<class T, class V, class U>
|
||||
class GUI_EXPORT QgsSettingsEditorWidgetWrapperTemplate : public QgsSettingsEditorWidgetWrapper
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
QgsSettingsEditorWidgetWrapperTemplate( QObject *parent = nullptr )
|
||||
: QgsSettingsEditorWidgetWrapper( parent ) {}
|
||||
|
||||
@ -66,6 +67,7 @@ class GUI_EXPORT QgsSettingsEditorWidgetWrapperTemplate : public QgsSettingsEdit
|
||||
setWidgetValue( mSetting->convertFromVariant( value ) );
|
||||
}
|
||||
|
||||
//! Sets the widget value
|
||||
virtual bool setWidgetValue( const U &value ) const = 0;
|
||||
|
||||
QVariant variantValueFromWidget() const override
|
||||
@ -73,6 +75,7 @@ class GUI_EXPORT QgsSettingsEditorWidgetWrapperTemplate : public QgsSettingsEdit
|
||||
return valueFromWidget();
|
||||
};
|
||||
|
||||
//! Returns the widget value
|
||||
virtual U valueFromWidget() const = 0;
|
||||
|
||||
//! Returns the editor
|
||||
@ -120,6 +123,7 @@ class GUI_EXPORT QgsSettingsEditorWidgetWrapperTemplate : public QgsSettingsEdit
|
||||
class GUI_EXPORT QgsSettingsStringEditorWidgetWrapper : public QgsSettingsEditorWidgetWrapperTemplate<QgsSettingsEntryString, QLineEdit, QString>
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
QgsSettingsStringEditorWidgetWrapper( QObject *parent = nullptr )
|
||||
: QgsSettingsEditorWidgetWrapperTemplate<QgsSettingsEntryString, QLineEdit, QString>( parent ) {}
|
||||
|
||||
@ -143,6 +147,7 @@ class GUI_EXPORT QgsSettingsStringEditorWidgetWrapper : public QgsSettingsEditor
|
||||
class GUI_EXPORT QgsSettingsBoolEditorWidgetWrapper : public QgsSettingsEditorWidgetWrapperTemplate<QgsSettingsEntryBool, QCheckBox, bool>
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
QgsSettingsBoolEditorWidgetWrapper( QObject *parent = nullptr )
|
||||
: QgsSettingsEditorWidgetWrapperTemplate<QgsSettingsEntryBool, QCheckBox, bool>( parent ) {}
|
||||
|
||||
@ -166,6 +171,7 @@ class GUI_EXPORT QgsSettingsBoolEditorWidgetWrapper : public QgsSettingsEditorWi
|
||||
class GUI_EXPORT QgsSettingsIntegerEditorWidgetWrapper : public QgsSettingsEditorWidgetWrapperTemplate<QgsSettingsEntryInteger, QSpinBox, int>
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
QgsSettingsIntegerEditorWidgetWrapper( QObject *parent = nullptr )
|
||||
: QgsSettingsEditorWidgetWrapperTemplate<QgsSettingsEntryInteger, QSpinBox, int>( parent ) {}
|
||||
|
||||
@ -190,6 +196,7 @@ class GUI_EXPORT QgsSettingsIntegerEditorWidgetWrapper : public QgsSettingsEdito
|
||||
class GUI_EXPORT QgsSettingsDoubleEditorWidgetWrapper : public QgsSettingsEditorWidgetWrapperTemplate<QgsSettingsEntryDouble, QDoubleSpinBox, double>
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
QgsSettingsDoubleEditorWidgetWrapper( QObject *parent = nullptr )
|
||||
: QgsSettingsEditorWidgetWrapperTemplate<QgsSettingsEntryDouble, QDoubleSpinBox, double>( parent ) {}
|
||||
|
||||
@ -214,6 +221,7 @@ class GUI_EXPORT QgsSettingsDoubleEditorWidgetWrapper : public QgsSettingsEditor
|
||||
class GUI_EXPORT QgsSettingsColorEditorWidgetWrapper : public QgsSettingsEditorWidgetWrapperTemplate<QgsSettingsEntryColor, QgsColorButton, QColor>
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
QgsSettingsColorEditorWidgetWrapper( QObject *parent = nullptr )
|
||||
: QgsSettingsEditorWidgetWrapperTemplate<QgsSettingsEntryColor, QgsColorButton, QColor>( parent ) {}
|
||||
|
||||
|
@ -63,10 +63,10 @@ class GUI_EXPORT QgsSettingsTreeModelNodeData : public QObject
|
||||
void applyChanges();
|
||||
|
||||
//! Returns if the node is the root node
|
||||
bool isRoot() const {return mParent == nullptr;}
|
||||
bool isRoot() const { return mParent == nullptr; }
|
||||
|
||||
//! Returns the dynamic key parts of the named list parent tree nodes
|
||||
QStringList namedParentNodes() const {return mNamedParentNodes;}
|
||||
QStringList namedParentNodes() const { return mNamedParentNodes; }
|
||||
|
||||
//! Returns the children nodes of the node (setting or tree node)
|
||||
QList<QgsSettingsTreeModelNodeData *> children() const {return mChildren;}
|
||||
@ -86,7 +86,7 @@ class GUI_EXPORT QgsSettingsTreeModelNodeData : public QObject
|
||||
//! Returns the value of the node (setting or tree node)
|
||||
QVariant originalValue() const {return mOriginalValue;}
|
||||
|
||||
//! Sets the value of the setting node
|
||||
//! Sets the \a value of the setting node
|
||||
bool setValue( const QVariant &value );
|
||||
|
||||
//! Returns if the setting exists (value is set)
|
||||
@ -96,8 +96,8 @@ class GUI_EXPORT QgsSettingsTreeModelNodeData : public QObject
|
||||
bool isEdited() const {return mIsEdited;}
|
||||
|
||||
/**
|
||||
* Returns the setting of the node
|
||||
* It returns a nullptr if the setting does not exist
|
||||
* Returns a pointer to the setting of the node or NULLPTR if the
|
||||
* setting does not exist.
|
||||
*/
|
||||
const QgsSettingsEntryBase *setting() const {return mSetting;}
|
||||
|
||||
@ -179,10 +179,11 @@ class GUI_EXPORT QgsSettingsTreeModel : public QAbstractItemModel
|
||||
|
||||
~QgsSettingsTreeModel();
|
||||
|
||||
//! Apply pending changes in the model to the corresponding settings
|
||||
void applyChanges();
|
||||
|
||||
/**
|
||||
* Returns settings tree node for given index. Returns root node for invalid index.
|
||||
* Returns settings tree node for given \a index or the root node if the index is invalid.
|
||||
*/
|
||||
QgsSettingsTreeModelNodeData *index2node( const QModelIndex &index ) const SIP_SKIP;
|
||||
|
||||
|
@ -39,7 +39,7 @@ class GUI_EXPORT QgsSettingsTreeWidget : public QWidget
|
||||
explicit QgsSettingsTreeWidget( QWidget *parent = nullptr );
|
||||
|
||||
|
||||
// Apply changes to settings value
|
||||
//! Apply changes to settings value
|
||||
void applyChanges() const;
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user