/************************************************************************ * This file has been generated automatically from * * * * src/core/settings/qgssettingstreenode.h * * * * Do not edit manually ! Edit header and run scripts/sipify.py again * ************************************************************************/ class QgsSettingsTreeNode { %Docstring(signature="appended") A tree node for the settings tree to help organizing and introspecting the tree. It is either a root node, a normal node or a named list (to store a group of settings under a dynamic named key). to automatically register a settings entry on its creation when a parent is provided. .. seealso:: :py:class:`QgsSettingsTree` .. seealso:: :py:class:`QgsSettingsEntryBase` .. versionadded:: 3.30 %End %TypeHeaderCode #include "qgssettingstreenode.h" %End %ConvertToSubClassCode if ( dynamic_cast< QgsSettingsTreeNamedListNode * >( sipCpp ) ) sipType = sipType_QgsSettingsTreeNamedListNode; else if ( dynamic_cast< QgsSettingsTreeNode * >( sipCpp ) ) sipType = sipType_QgsSettingsTreeNode; else sipType = NULL; %End public: static const QMetaObject staticMetaObject; public: virtual ~QgsSettingsTreeNode(); QgsSettingsTreeNode *createChildNode( const QString &key ) throw( QgsSettingsException ) /KeepReference/; %Docstring Creates a normal tree node It will return the existing child node if it exists at the given key :raises QgsSettingsException: if a setting exists with the same key %End QgsSettingsTreeNamedListNode *createNamedListNode( const QString &key, const Qgis::SettingsTreeNodeOptions &options = Qgis::SettingsTreeNodeOptions() ) throw( QgsSettingsException ) /KeepReference/; %Docstring Creates a named list tree node. This is useful to register groups of settings for several named items (for instance credentials for several named services) %End Qgis::SettingsTreeNodeType type() const; %Docstring Returns the type of node %End void registerChildSetting( const QgsSettingsEntryBase *setting, const QString &key ) throw( QgsSettingsException ); %Docstring Registers a child setting :param setting: the setting to register :param key: the key of the setting (not the complete key from its parents) .. note:: Ownership of the setting is transferred .. note:: The registration is automatically done when calling the setting's constructor with the parent argument signature :raises QgsSettingsException: if a setting exists with the same key %End void unregisterChildSetting( const QgsSettingsEntryBase *setting, bool deleteSettingValues = false, const QStringList &parentsNamedItems = QStringList() ); %Docstring Unregisters the child setting :param setting: the setting to unregister :param deleteSettingValues: if ``True``, the values of the settings will also be deleted :param parentsNamedItems: the list of named items in the parent named list (if any) %End void unregisterChildNode( QgsSettingsTreeNode *node ); %Docstring Unregisters the child tree ``node`` %End QList childrenNodes() const; %Docstring Returns the children nodes %End QgsSettingsTreeNode *childNode( const QString &key ) const; %Docstring Returns the existing child node if it exists at the given ``key`` %End QList childrenSettings() const; %Docstring Returns the children settings %End const QgsSettingsEntryBase *childSetting( const QString &key ) const; %Docstring Returns the existing child settings if it exists at the given ``key`` %End QgsSettingsTreeNode *parent() const; %Docstring Returns the parent of the node or None if it does not exists %End QString key() const; %Docstring Returns the key of the node (without its parents) %End QString completeKey() const; %Docstring Returns the complete key of the node (including its parents) %End int namedNodesCount() const; %Docstring Returns the number of named nodes in the complete key %End SIP_PYOBJECT __repr__(); %MethodCode const QMetaEnum metaEnum = QMetaEnum::fromType(); QString str = QStringLiteral( "" ).arg( metaEnum.valueToKey( static_cast( sipCpp->type() ) ), sipCpp->key() ); sipRes = PyUnicode_FromString( str.toUtf8().constData() ); %End protected: void registerChildNode( QgsSettingsTreeNode *node ); %Docstring Registers a child nodes %End private: QgsSettingsTreeNode(); %Docstring Default constructor for QgsSettingsTreeNode. .. note:: This is not available in Python bindings. Use method createNode on an existing tree node. .. seealso:: :py:func:`QgsSettingsTree.createPluginTreeNode` %End QgsSettingsTreeNode( const QgsSettingsTreeNode &other ); }; class QgsSettingsTreeNamedListNode : QgsSettingsTreeNode { %Docstring(signature="appended") A named list tree node for the settings tree to help organizing and introspecting the tree. The named list node is used to store a group of settings under a dynamically named key. .. seealso:: :py:class:`QgsSettingsTree` .. seealso:: :py:class:`QgsSettingsTreeNode` .. seealso:: :py:class:`QgsSettingsEntryBase` .. versionadded:: 3.30 %End %TypeHeaderCode #include "qgssettingstreenode.h" %End public: virtual ~QgsSettingsTreeNamedListNode(); QStringList items( const QStringList &parentsNamedItems = QStringList() ) const throw( QgsSettingsException ); %Docstring Returns the list of items :param parentsNamedItems: the list of named items in the parent named list (if any) :raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition %End QStringList items( Qgis::SettingsOrigin origin, const QStringList &parentsNamedItems = QStringList() ) const throw( QgsSettingsException ); %Docstring Returns the list of items :param origin: can be used to restrict the origin of the setting (local or global) :param parentsNamedItems: the list of named items in the parent named list (if any) :raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition %End void setSelectedItem( const QString &item, const QStringList &parentsNamedItems = QStringList() ) throw( QgsSettingsException ); %Docstring Sets the selected named item from the named list node :param item: the item to set as selected :param parentsNamedItems: the list of named items in the parent named list (if any) :raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition %End QString selectedItem( const QStringList &parentsNamedItems = QStringList() ) throw( QgsSettingsException ); %Docstring Returns the selected named item from the named list node :param parentsNamedItems: the list of named items in the parent named list (if any) :raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition %End void deleteItem( const QString &item, const QStringList &parentsNamedItems = QStringList() ) throw( QgsSettingsException ); %Docstring Deletes a named item from the named list node :param item: the item to delete :param parentsNamedItems: the list of named items in the parent named list (if any) :raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition %End void deleteAllItems( const QStringList &parentsNamedItems = QStringList() ) throw( QgsSettingsException ); %Docstring Deletes all items from the named list node :param parentsNamedItems: the list of named items in the parent named list (if any) :raises QgsSettingsException: if the number of given parent named items doesn't match the complete key definition .. versionadded:: 3.30.1 %End const QgsSettingsEntryString *selectedItemSetting() const; %Docstring Returns the setting used to store the selected item %End protected: void initNamedList( const Qgis::SettingsTreeNodeOptions &options ); %Docstring Init the nodes with the specific ``options`` %End private: QgsSettingsTreeNamedListNode(); %Docstring Constructor for QgsSettingsTreeNamedListNode. .. note:: This is not available in Python bindings. Use method createNamedListNode on an existing tree node. .. seealso:: :py:func:`QgsSettingsTree.createPluginTreeNode` %End }; /************************************************************************ * This file has been generated automatically from * * * * src/core/settings/qgssettingstreenode.h * * * * Do not edit manually ! Edit header and run scripts/sipify.py again * ************************************************************************/