QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Signals | Public Member Functions | Static Public Member Functions | List of all members
QgsVectorLayerJoinBuffer Class Reference

Manages joined fields for a vector layer. More...

#include <qgsvectorlayerjoinbuffer.h>

Inheritance diagram for QgsVectorLayerJoinBuffer:
Inheritance graph
[legend]

Signals

void joinedFieldsChanged ()
 Emitted whenever the list of joined fields changes (e.g. More...
 

Public Member Functions

 QgsVectorLayerJoinBuffer (QgsVectorLayer *layer=nullptr)
 
 ~QgsVectorLayerJoinBuffer ()
 
bool addJoin (const QgsVectorJoinInfo &joinInfo)
 Joins another vector layer to this layer. More...
 
QgsVectorLayerJoinBufferclone () const
 Create a copy of the join buffer. More...
 
bool containsJoins () const
 Quick way to test if there is any join at all. More...
 
void createJoinCaches ()
 Calls cacheJoinLayer() for all vector joins. More...
 
int joinedFieldsOffset (const QgsVectorJoinInfo *info, const QgsFields &fields)
 Find out what is the first index of the join within fields. More...
 
const QgsVectorJoinInfojoinForFieldIndex (int index, const QgsFields &fields, int &sourceFieldIndex) const
 Finds the vector join for a layer field index. More...
 
void readXml (const QDomNode &layer_node)
 Reads joins from project file. More...
 
bool removeJoin (const QString &joinLayerId)
 Removes a vector layer join. More...
 
void updateFields (QgsFields &fields)
 Updates field map with joined attributes. More...
 
const QgsVectorJoinListvectorJoins () const
 
void writeXml (QDomNode &layer_node, QDomDocument &document) const
 Saves mVectorJoins to xml under the layer node. More...
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual ~QObject ()
 
bool blockSignals (bool block)
 
QObjectchild (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArraydynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObjectparent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThreadthread () const
 

Static Public Member Functions

static QVector< int > joinSubsetIndices (QgsVectorLayer *joinLayer, const QStringList &joinFieldsSubset)
 Return a vector of indices for use in join based on field names from the layer. More...
 
- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 

Additional Inherited Members

- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObjectsender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Manages joined fields for a vector layer.

Definition at line 33 of file qgsvectorlayerjoinbuffer.h.

Constructor & Destructor Documentation

◆ QgsVectorLayerJoinBuffer()

QgsVectorLayerJoinBuffer::QgsVectorLayerJoinBuffer ( QgsVectorLayer layer = nullptr)

Definition at line 25 of file qgsvectorlayerjoinbuffer.cpp.

◆ ~QgsVectorLayerJoinBuffer()

QgsVectorLayerJoinBuffer::~QgsVectorLayerJoinBuffer ( )

Definition at line 30 of file qgsvectorlayerjoinbuffer.cpp.

Member Function Documentation

◆ addJoin()

bool QgsVectorLayerJoinBuffer::addJoin ( const QgsVectorJoinInfo joinInfo)

Joins another vector layer to this layer.

Parameters
joinInfojoin object containing join layer id, target and source field
Returns
(since 2.6) whether the join was successfully added

Definition at line 63 of file qgsvectorlayerjoinbuffer.cpp.

◆ clone()

QgsVectorLayerJoinBuffer * QgsVectorLayerJoinBuffer::clone ( ) const

Create a copy of the join buffer.

Note
added in 2.6

Definition at line 403 of file qgsvectorlayerjoinbuffer.cpp.

◆ containsJoins()

bool QgsVectorLayerJoinBuffer::containsJoins ( ) const
inline

Quick way to test if there is any join at all.

Definition at line 64 of file qgsvectorlayerjoinbuffer.h.

◆ createJoinCaches()

void QgsVectorLayerJoinBuffer::createJoinCaches ( )

Calls cacheJoinLayer() for all vector joins.

Definition at line 264 of file qgsvectorlayerjoinbuffer.cpp.

◆ joinedFieldsChanged

void QgsVectorLayerJoinBuffer::joinedFieldsChanged ( )
signal

Emitted whenever the list of joined fields changes (e.g.

added join or joined layer's fields change)

Note
added in 2.6

◆ joinedFieldsOffset()

int QgsVectorLayerJoinBuffer::joinedFieldsOffset ( const QgsVectorJoinInfo info,
const QgsFields fields 
)

Find out what is the first index of the join within fields.

Returns -1 if join is not present

Note
added in 2.6

Definition at line 368 of file qgsvectorlayerjoinbuffer.cpp.

◆ joinForFieldIndex()

const QgsVectorJoinInfo * QgsVectorLayerJoinBuffer::joinForFieldIndex ( int  index,
const QgsFields fields,
int &  sourceFieldIndex 
) const

Finds the vector join for a layer field index.

Parameters
indexthis layers attribute index
fieldsfields of the vector layer (including joined fields)
sourceFieldIndexOutput: field's index in source layer

Definition at line 388 of file qgsvectorlayerjoinbuffer.cpp.

◆ joinSubsetIndices()

QVector< int > QgsVectorLayerJoinBuffer::joinSubsetIndices ( QgsVectorLayer joinLayer,
const QStringList joinFieldsSubset 
)
static

Return a vector of indices for use in join based on field names from the layer.

Note
added in 2.6

Definition at line 188 of file qgsvectorlayerjoinbuffer.cpp.

◆ readXml()

void QgsVectorLayerJoinBuffer::readXml ( const QDomNode layer_node)

Reads joins from project file.

Definition at line 328 of file qgsvectorlayerjoinbuffer.cpp.

◆ removeJoin()

bool QgsVectorLayerJoinBuffer::removeJoin ( const QString joinLayerId)

Removes a vector layer join.

Returns
true if join was found and successfully removed

Definition at line 101 of file qgsvectorlayerjoinbuffer.cpp.

◆ updateFields()

void QgsVectorLayerJoinBuffer::updateFields ( QgsFields fields)

Updates field map with joined attributes.

Parameters
fieldsmap to append joined attributes

Definition at line 209 of file qgsvectorlayerjoinbuffer.cpp.

◆ vectorJoins()

const QgsVectorJoinList& QgsVectorLayerJoinBuffer::vectorJoins ( ) const
inline

Definition at line 66 of file qgsvectorlayerjoinbuffer.h.

◆ writeXml()

void QgsVectorLayerJoinBuffer::writeXml ( QDomNode layer_node,
QDomDocument document 
) const

Saves mVectorJoins to xml under the layer node.

Definition at line 283 of file qgsvectorlayerjoinbuffer.cpp.


The documentation for this class was generated from the following files: