QGIS/python/core/qgsrelationmanager.sip

145 lines
4.4 KiB
Plaintext
Raw Normal View History

2017-05-18 16:39:21 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsrelationmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
2014-01-27 09:22:24 +01:00
class QgsRelationManager : QObject
{
2017-05-18 16:39:21 +02:00
%Docstring
This class manages a set of relations between layers.
%End
2014-01-27 09:22:24 +01:00
%TypeHeaderCode
#include "qgsrelationmanager.h"
%End
public:
explicit QgsRelationManager( QgsProject *project = 0 );
2017-05-18 16:39:21 +02:00
%Docstring
Constructor for QgsRelationManager.
\param project associated project (used to notify project of changes)
%End
2014-01-27 09:22:24 +01:00
void setRelations( const QList<QgsRelation> &relations );
2017-05-18 16:39:21 +02:00
%Docstring
Will set the specified relations and remove any relation currently set.
\param relations A list of relations to set.
%End
2015-02-03 02:21:52 +01:00
QMap<QString, QgsRelation> relations() const;
2017-05-18 16:39:21 +02:00
%Docstring
Get access to the relations managed by this class.
:return: A QMap where the key is the relation id, the value the relation object.
:rtype: QMap<str, QgsRelation>
%End
2015-02-03 02:21:52 +01:00
void addRelation( const QgsRelation &relation );
2017-05-18 16:39:21 +02:00
%Docstring
Add a relation.
\param relation The relation to add.
%End
2015-02-03 02:21:52 +01:00
void removeRelation( const QString &id );
2017-05-18 16:39:21 +02:00
%Docstring
Remove a relation.
\param id The id of the relation to remove.
%End
2015-02-03 02:21:52 +01:00
void removeRelation( const QgsRelation &relation );
2017-05-18 16:39:21 +02:00
%Docstring
Remove a relation.
\param relation The relation to remove.
%End
2015-02-03 02:21:52 +01:00
QgsRelation relation( const QString &id ) const;
2017-05-18 16:39:21 +02:00
%Docstring
Get access to a relation by its id.
\param id The id to search for
:return: A relation. Invalid if not found.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`relationsByName()`
2017-05-18 16:39:21 +02:00
:rtype: QgsRelation
%End
2015-02-03 02:21:52 +01:00
QList<QgsRelation> relationsByName( const QString &name ) const;
2017-05-18 16:39:21 +02:00
%Docstring
Returns a list of relations with matching names.
\param name relation name to search for. Searching is case insensitive.
:return: a list of matching relations
.. versionadded:: 2.16
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`relation()`
2017-05-18 16:39:21 +02:00
:rtype: list of QgsRelation
%End
2014-01-27 09:22:24 +01:00
void clear();
2017-05-18 16:39:21 +02:00
%Docstring
Remove any relation managed by this class.
%End
2014-01-27 09:22:24 +01:00
QList<QgsRelation> referencingRelations( const QgsVectorLayer *layer = 0, int fieldIdx = -2 ) const;
2017-05-18 16:39:21 +02:00
%Docstring
Get all relations where the specified layer (and field) is the referencing part (i.e. the child table with the foreign key).
\param layer The layer which should be searched for.
\param fieldIdx The field which should be part of the foreign key. If not set will return all relations.
:return: A list of relations matching the given layer and fieldIdx.
:rtype: list of QgsRelation
%End
2015-02-03 02:21:52 +01:00
2014-01-27 09:22:24 +01:00
QList<QgsRelation> referencedRelations( QgsVectorLayer *layer = 0 ) const;
2017-05-18 16:39:21 +02:00
%Docstring
Get all relations where this layer is the referenced part (i.e. the parent table with the primary key being referenced from another layer).
2014-01-27 09:22:24 +01:00
2017-05-18 16:39:21 +02:00
\param layer The layer which should be searched for.
:return: A list of relations where the specified layer is the referenced part.
:rtype: list of QgsRelation
%End
static QList<QgsRelation> discoverRelations( const QList<QgsRelation> &existingRelations, const QList<QgsVectorLayer *> &layers );
%Docstring
Discover all the relations available from the current layers.
\param existingRelations the existing relations to filter them out
\param layers the current layers
:return: the list of discovered relations
.. versionadded:: 3.0
:rtype: list of QgsRelation
%End
2014-01-27 09:22:24 +01:00
signals:
void relationsLoaded();
2017-05-18 16:39:21 +02:00
%Docstring
This signal is emitted when the relations were loaded after reading a project
%End
2014-11-13 23:13:13 +01:00
void changed();
2017-05-18 16:39:21 +02:00
%Docstring
Emitted when relations are added or removed to the manager.
.. versionadded:: 2.5
%End
2014-01-27 09:22:24 +01:00
};
2017-05-18 16:39:21 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsrelationmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/