QGIS API Documentation
2.8.2-Wien
|
Manages joined fields for a vector layer. More...
#include <qgsvectorlayerjoinbuffer.h>
Signals | |
void | joinedFieldsChanged () |
Emitted whenever the list of joined fields changes (e.g. |
Public Member Functions | |
QgsVectorLayerJoinBuffer (QgsVectorLayer *layer=0) | |
~QgsVectorLayerJoinBuffer () | |
bool | addJoin (const QgsVectorJoinInfo &joinInfo) |
Joins another vector layer to this layer. | |
QgsVectorLayerJoinBuffer * | clone () const |
Create a copy of the join buffer. | |
bool | containsJoins () const |
Quick way to test if there is any join at all. | |
void | createJoinCaches () |
Calls cacheJoinLayer() for all vector joins. | |
int | joinedFieldsOffset (const QgsVectorJoinInfo *info, const QgsFields &fields) |
Find out what is the first index of the join within fields. | |
const QgsVectorJoinInfo * | joinForFieldIndex (int index, const QgsFields &fields, int &sourceFieldIndex) const |
Finds the vector join for a layer field index. | |
void | readXml (const QDomNode &layer_node) |
Reads joins from project file. | |
void | removeJoin (const QString &joinLayerId) |
Removes a vector layer join. | |
void | updateFields (QgsFields &fields) |
Updates field map with joined attributes. | |
const QgsVectorJoinList & | vectorJoins () const |
void | writeXml (QDomNode &layer_node, QDomDocument &document) const |
Saves mVectorJoins to xml under the layer node. |
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. |
Manages joined fields for a vector layer.
Definition at line 32 of file qgsvectorlayerjoinbuffer.h.
QgsVectorLayerJoinBuffer::QgsVectorLayerJoinBuffer | ( | QgsVectorLayer * | layer = 0 | ) |
Definition at line 25 of file qgsvectorlayerjoinbuffer.cpp.
QgsVectorLayerJoinBuffer::~QgsVectorLayerJoinBuffer | ( | ) |
Definition at line 30 of file qgsvectorlayerjoinbuffer.cpp.
bool QgsVectorLayerJoinBuffer::addJoin | ( | const QgsVectorJoinInfo & | joinInfo | ) |
Joins another vector layer to this layer.
joinInfo | join object containing join layer id, target and source field |
Definition at line 63 of file qgsvectorlayerjoinbuffer.cpp.
QgsVectorLayerJoinBuffer * QgsVectorLayerJoinBuffer::clone | ( | ) | const |
Create a copy of the join buffer.
Definition at line 383 of file qgsvectorlayerjoinbuffer.cpp.
|
inline |
Quick way to test if there is any join at all.
Definition at line 62 of file qgsvectorlayerjoinbuffer.h.
void QgsVectorLayerJoinBuffer::createJoinCaches | ( | ) |
Calls cacheJoinLayer() for all vector joins.
Definition at line 250 of file qgsvectorlayerjoinbuffer.cpp.
|
signal |
Emitted whenever the list of joined fields changes (e.g.
added join or joined layer's fields change)
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
Definition at line 348 of file qgsvectorlayerjoinbuffer.cpp.
const QgsVectorJoinInfo * QgsVectorLayerJoinBuffer::joinForFieldIndex | ( | int | index, |
const QgsFields & | fields, | ||
int & | sourceFieldIndex | ||
) | const |
Finds the vector join for a layer field index.
index | this layers attribute index |
fields | fields of the vector layer (including joined fields) |
sourceFieldIndex | Output: field's index in source layer |
Definition at line 368 of file qgsvectorlayerjoinbuffer.cpp.
|
static |
Return a vector of indices for use in join based on field names from the layer.
Definition at line 175 of file qgsvectorlayerjoinbuffer.cpp.
void QgsVectorLayerJoinBuffer::readXml | ( | const QDomNode & | layer_node | ) |
Reads joins from project file.
Definition at line 309 of file qgsvectorlayerjoinbuffer.cpp.
void QgsVectorLayerJoinBuffer::removeJoin | ( | const QString & | joinLayerId | ) |
Removes a vector layer join.
Definition at line 95 of file qgsvectorlayerjoinbuffer.cpp.
void QgsVectorLayerJoinBuffer::updateFields | ( | QgsFields & | fields | ) |
Updates field map with joined attributes.
fields | map to append joined attributes |
Definition at line 196 of file qgsvectorlayerjoinbuffer.cpp.
|
inline |
Definition at line 64 of file qgsvectorlayerjoinbuffer.h.
void QgsVectorLayerJoinBuffer::writeXml | ( | QDomNode & | layer_node, |
QDomDocument & | document | ||
) | const |
Saves mVectorJoins to xml under the layer node.
Definition at line 264 of file qgsvectorlayerjoinbuffer.cpp.